MySQL Error 20, -20 in osCommerce

Anna-Marie asks;
I went into the admin section to put some products on special & it says the following & I don't know why it is there or how to fix it.
"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"
This is quite a common error and is to do with the version of MySQL that your host is using. Basically it's a bug in the osCommerce code...
To fix this is quite simple...I'm assuming you are using an older version of osCommerce such as MS2...
Open the following file: /includes/classes/split_page_results.php
Find this code:
-
$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;
Change it to:
Also open the following file: /admin/includes/classes/split_page_results.php and make the exact same change!





Thank-you so very much, in under 2 minutes & it was fixed. Brilliant!
Comment by Anna-marie — May 26, 2008 @ 9:41 am
Anna-marie – you are welcome.
Comment by Gary — May 26, 2008 @ 9:51 am