delite163 Posted July 25, 2005 Share Posted July 25, 2005 Hi all, I have a problem with this error and I don't know how to correct it. The error says to check the manual that corresponds to you MySql server version. Where would I find this manual? Reviews Products Rating Date Added Action 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 reviews_id, products_id, date_added, last_modified, reviews_rating from reviews order by date_added DESC limit -20, 20 [TEP STOP] Thank you Link to comment Share on other sites More sharing options...
Jack_mcs Posted July 25, 2005 Share Posted July 25, 2005 See this link. Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
6thirty Posted July 25, 2005 Share Posted July 25, 2005 Hi Susan, Basically, the error is telling you that the syntax (the way the words are arranged) is incorrect on that line of code. The hint given is that the fault is near -20,20. My store is far from standard, so I may be wrong here, but try looking at line 198 of admin/reviews.php. At the end of the line you should see "order by date_added DESC limit -20, 20". The MySQL limit command tells the database to only display a certain number of records ie limit 10 would only retrieve the first 10. And limit 5,10 would retrieve records 6-15. Your code is telling the database to display the results between -19 and 1 which is invalid (you cant retrieve a negative result). Either try removing the "limit -20,20" altogether, or adjusting the -20 to a positive value. And to answer your question, you can find the manual at: http://dev.mysql.com/doc/mysql/en/ Hope this helps :thumbsup: Link to comment Share on other sites More sharing options...
delite163 Posted July 26, 2005 Author Share Posted July 26, 2005 Hi Susan, Basically, the error is telling you that the syntax (the way the words are arranged) is incorrect on that line of code. The hint given is that the fault is near -20,20. My store is far from standard, so I may be wrong here, but try looking at line 198 of admin/reviews.php. At the end of the line you should see "order by date_added DESC limit -20, 20". The MySQL limit command tells the database to only display a certain number of records ie limit 10 would only retrieve the first 10. And limit 5,10 would retrieve records 6-15. Your code is telling the database to display the results between -19 and 1 which is invalid (you cant retrieve a negative result). Either try removing the "limit -20,20" altogether, or adjusting the -20 to a positive value. And to answer your question, you can find the manual at: http://dev.mysql.com/doc/mysql/en/ Hope this helps :thumbsup: <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
delite163 Posted July 26, 2005 Author Share Posted July 26, 2005 <{POST_SNAPBACK}> Hi all, Just a note to let you know that I did some fumbling around and found that When I deleted the original review of the demo review it caused this syntax error. When I added a review of my own the error was corrected. Being new I really don't know what that means unless if the review for the demo product was deleted then the error occured. Now that I have added a new review but maybe I deleted wrong. Any suggestons? thank you Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.