Jump to content



Photo
- - - - -

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


  • Please log in to reply
2 replies to this topic

#1   Evinrude9.5

Evinrude9.5
  • Members
  • 18 posts
  • Real Name:Seahorse
  • Gender:Male

Posted 21 February 2017 - 04:11

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.

 

 

 



#2 ONLINE   frankl

frankl

    One of the originals...

  • Community Sponsor
  • 471 posts
  • Real Name:Frank
  • Gender:Male
  • Location:Sydney, Australia

Posted 21 February 2017 - 05:46

There has been a change to your server which mucks up the curly braces. Talk to your host or follow these instructions http://forums.oscomm...utes/?p=1748469


Let's make things easier for new osCommerce users http://forums.oscomm...bles/?p=1718900  Getting there with osCommerce 2.4! :thumbsup:


#3   Evinrude9.5

Evinrude9.5
  • Members
  • 18 posts
  • Real Name:Seahorse
  • Gender:Male

Posted 22 February 2017 - 04:30

There has been a change to your server which mucks up the curly braces. Talk to your host or follow these instructions http://forums.oscomm...utes/?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.