1064 Error in Oscommerce Shopping Cart

I just tried to install oscommerce Shopping Cart, and has been playing around with some cool template. But since yesterday i found some error which is looks like a common error which is cause by mysql version.
This is the error message i got when i tried to click on reviews section in admin page:
 

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

This error also occur in the special.php page inside admin section. After search on google, finally i found a way to fix it:  Here is how to fix this problem:

Find split_page_results.php page inside the admin/includes/classes folder. Open the file then just under this code:
 $offset = ($max_rows_per_page * ($current_page_number - 1));
Add this code:

if ($offset < 0)
{
$offset = 0 ;
}

By adding above code , now i able to view the reviews and special page in admin section.

Comments

Leave a Reply