Latest News: (loading..)
Evinrude9.5

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 '{1}2{2}3

3 posts in this topic

Hi,

 

I have a site running os2.31, The site has been running well for quite a while. Having not touched any thing but suddenly got a problem when click on the product in page "what is in my cart?" (shopping_cart.php), the error message will show on the coming product_info page as following:

 

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 '{1}2{2}3' at line 1

select manufacturers_id from products where products_id = 5655{1}2{2}3

 

It has been working fine previously. The product contains two attributes, so shopping_cart generats the $products_id=5655{1}2{2}3, when hover on the product name or image the status bar pointing to /product_info.php?products_id=5655{1}2{2}3, then after click will go to the product page and highlight the related two attributes.

 

I did not change anything on product_info page, and shopping_cart.php either. Could anything from the server get this error happened?

 

Please point out something if possible.

 

Thanks.

 

 

 

Share this post


Link to post
Share on other sites

There has been a change to your server which mucks up the curly braces. Talk to your host or follow these instructions http://forums.oscommerce.com/topic/410291-shopping-cart-rejects-products-with-attributes/?p=1748469

Thanks for your info. I looked into that thread, it seems like a bit over my level.

 

For a quick fix, within the shopping_cart.php, I just replaced the parameter "$products[$i]['id']" to "substr($products[$i]['id'],0,strpos($products[$i]['id'],'{'))" to take the products_id only before the left curly bracket.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now