nrm99 Posted October 6, 2011 Posted October 6, 2011 I have recently gotten back involved with a client who I set up with OSCommerce about 6 years ago (version 2.2-MS2). The Specials section used to work and they never told me that it wasn't working any more but I just went in to the Special section in administration and I get the 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 '-20, 20' at line 1 select p.products_id, pd.products_name, p.products_price, s.specials_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, s.date_status_change, s.status from products p, specials s, products_description pd where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = s.products_id order by pd.products_name limit -20, 20 [TEP STOP] I don't understand why it wouldn't be working any more and I certainly don't understand what needs to be done to correct the error. By the way I'm getting a similar error when I go to Reviews. I would appreciate any help I can get.
MrPhil Posted October 7, 2011 Posted October 7, 2011 Search for this error on this forum and you will get many hits. Google site:www.oscommerce.com/forums "limit -20, 20" if the osC forum search doesn't work. Basically, your host upgraded PHP and/or MySQL, and the newer version is less tolerant of negative row numbers (doesn't treat them as 0). The solution is to go into both "split_page_results.php" files and change $offset to max($offset, 0) in the limit clause code. A better solution is to upgrade to osC 2.3.1 (not 3.0.2!).
Recommended Posts
Archived
This topic is now archived and is closed to further replies.