Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Evinrude9.5

Recommended Posts

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.

 

 

 

Link to comment
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://www.oscommerce.com/forums/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.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...