Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SQL Server Version Syntax Error


Guest

Recommended Posts

Posted

Hello Everyone,

 

 

At first, I was thinking that this may of been a contribution problem.. But now with me researching this issue back and forth like a crazy person.. I'm thinking.. It could be latest snapshot version related.. Not sure.. But in anycase.. I'm bringing it up in this part of the forum in hopes of getting some help..

 

Now, I'm receiving an error when I go into one of the test orders that I made. Only when I click on update.. What I mean is when trying to update from status's. From "pending" to "processing" Or just hitting that update button period causes this error below:

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' ipaddy, ipisp orders where orders_id = '13'' at line 1

select customers_name, customers_email_address, orders_status, date_purchased from, ipaddy, ipisp orders where orders_id = '13'

[TEP STOP]

 

After doing research on SQL errors and what may be the cause of this.. I think I found the line of code in question here.. Because it seems to change the error that I'm receiving a bit when I fool with it.. But doesn't fix it however.. I even took out the contribution that I was using that I thought may of been causing this.. But it's not.. And it appears to be more SQL version related and the use of correct coding perhaps..

By the way, the SQL version in which my host provider is using is, MySQL 4.0.25-standard.

Below is the line of code in question:

 

$order_updated = false;
	$check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from, ipaddy, ipisp " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
	$check_status = tep_db_fetch_array($check_status_query);

 

If anyone can help me out with this issue.. I would be most greatful. I've been stumped for a couple days now on this .. And i think i'mma crack! lol

 

Thanks again,

 

Christine

Posted

Try

 

$order_updated = false;

$check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from ipaddy, ipisp, " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

$check_status = tep_db_fetch_array($check_status_query);

Posted

No, I'm afraid that didn't work.. And thank you for trying. :)

 

Christine

Posted

You forgot the "from" I think:

 

$order_updated = false;
$check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from, ipaddy, ipisp from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
$check_status = tep_db_fetch_array($check_status_query);

Posted
You forgot the "from" I think:

 

$order_updated = false;
$check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from, ipaddy, ipisp from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
$check_status = tep_db_fetch_array($check_status_query);

 

Appears to be an extra 'from' appearing after 'date_purchased'. Try:

$check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased, ipaddy, ipisp from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

 

HTH.

Posted
Appears to be an extra 'from' appearing after 'date_purchased'. Try:

$check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased, ipaddy, ipisp from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

 

HTH.

 

 

Thank you so very much OsSea! This did the trick! And all is working again now. The extra "from" was indeed the problem.. And this was from the lastest snapshot too.. So the developer guys might wanna take that out for future reference.. lol ..

 

WOW, That had me stumped good too! Phewwww, thank god for OsCommerce Community! :)) And me too.. I have to give myself some credit.. I pinpointed the line of code that was the trouble at hand.. LOL

But I'm just happy all is working now.. For now anyways! lol Until the next line of code.. LOL

 

Thanks again for all your help guys! And a special thanks to OsSea! :)

 

Christine

Posted

Happy to hear that worked for you. Glad I could be of help. :)

 

As a side note, it appears the query got mixed up when someone dropped the 'IP Recorder' code in the wrong place. Not sure if they've added that contrib in the latest and greatest, but they may want to check for other instances of that code and remove them if they haven't intentionally added it. And it seems strange that in the original code you posted

select customers_name, customers_email_address, orders_status, date_purchased from, ipaddy, ipisp orders where orders_id = '13'

the query is not in the standard coding style as enigma1 posted

"select customers_name, customers_email_address, orders_status, date_purchased from, ipaddy, ipisp " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"

Might be something the Dev. team would want to have a look at?

 

Cheers.

Posted
Happy to hear that worked for you. Glad I could be of help. :)

 

As a side note, it appears the query got mixed up when someone dropped the 'IP Recorder' code in the wrong place. Not sure if they've added that contrib in the latest and greatest, but they may want to check for other instances of that code and remove them if they haven't intentionally added it. And it seems strange that in the original code you posted

select customers_name, customers_email_address, orders_status, date_purchased from, ipaddy, ipisp orders where orders_id = '13'

the query is not in the standard coding style as enigma1 posted

"select customers_name, customers_email_address, orders_status, date_purchased from, ipaddy, ipisp " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"

Might be something the Dev. team would want to have a look at?

 

Cheers.

 

 

Yes, either way, I think the development team should have a look at it.. lol :)

 

Do you think that the IP Recorder contribution was the cause of this? Or no? I'm reading you, but i'm not sure of your meaning persay..

 

The thing of it is for me is this.. I had already added the IP Recorder contribution prior to making any test products and purchases.. So I can't say for sure (as I mentioned above) if it was contribution related or SQL and OsCommerce latest snapshot related.. Regardless.. I'm interested.. And as I look around more in these support threads. I'm seeing other people having SQL errors etc etc.. So I'm hoping this is the only error I'll be seeing.. Cause it's nerve racking.. lol :P

 

Christine

Posted

Hi Christine,

 

Just looking at the way the query was organized, with the 'ipaddy, ipisp' dropped in after 'date_purchased from' instead of in between 'date_purchased' and 'from' led me to that conclusion. If you're the one who added the IP contrib and didn't test it before moving along, then it seems you might be the guilty party. If not, and your code base was direct from CVS, then it's definitely a Dev. problem.

 

And my point is moot about the non-standard coding style, as the error message displayed by MySQL was showing code that had already been parsed by PHP and therefore was showing the actual values for the TABLE_ORDERS and (int)$oID variables and not the variable names themselves. My apologies for any confusion there.

 

I visited your store and it seems to be working fine now, so as your signature says...

Posted
Hi Christine,

 

Just looking at the way the query was organized, with the 'ipaddy, ipisp' dropped in after 'date_purchased from' instead of in between 'date_purchased' and 'from' led me to that conclusion. If you're the one who added the IP contrib and didn't test it before moving along, then it seems you might be the guilty party. If not, and your code base was direct from CVS, then it's definitely a Dev. problem.

 

And my point is moot about the non-standard coding style, as the error message displayed by MySQL was showing code that had already been parsed by PHP and therefore was showing the actual values for the TABLE_ORDERS and (int)$oID variables and not the variable names themselves. My apologies for any confusion there.

 

I visited your store and it seems to be working fine now, so as your signature says...

 

Hi again Sea,

 

Yes.. when I initially got the error.. I started other tests.. In order to find out what was causing it.. I even took the ipaddy and ISP stuff completely out.. And I was still getting the error.. But one can never be too sure when it comes to PHP and SQL what causes what! LMAO

Cause it seems when there's one error.. It could mean multitudes of things.. And that's where the fun begins.. lolol :P

 

As for my store.. The store in which you visited is the old store from back in 2002.. I'm currently revamping my website which is currently IP based at present.. New logo and color scheme etc... etc... And it's the latest snapshot to boot.. So I'll feel comforted knowing i'm up to date.. And I can add better contributions too.. :)

 

I'll be sure to contact you and let you know when it's ready.. :)

 

Thanks again Sea..

 

Christine

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...