Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

MYSQL Error 1064. Limit -20, 20


Recommended Posts

Hi everybody?

I am getting this error on the reviews, manufacturers, specials and products_expected.php pages. I am using Mysql 4.x and I think they disabled unsigned numbers for Limits or something like that. Can anyone point me in the direction of fixing this.


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


Any help will be appreciated. Thanks! :thumbsup:

Link to comment
Share on other sites

There was a bug with oscommerce default core that was reported and I think it affects modules without items. There are 2 files that need mods.


1. catalog\includes\classes\split_page_results.php

Locate this line

$offset = ($this->number_of_rows_per_page * ($this->current_page_number - 1));


Below that line add this

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


2. ditto for the catalog\admin\includes\classes\split_page_results.php

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...