Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Tax Zone error


Just2Bad

Recommended Posts

Posted

When I select a tax zone I created and click detail to insert a sub I have this error message

 

Tax Zones

 

Country Zone 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 '-40, 40' at line 1

 

select a.association_id, a.zone_country_id, c.countries_name, a.zone_id, a.geo_zone_id, a.last_modified, a.date_added, z.zone_name from zones_to_geo_zones a left join countries c on a.zone_country_id = c.countries_id left join zones z on a.zone_id = z.zone_id where a.geo_zone_id = 12 order by association_id limit -40, 40

 

[TEP STOP]

Posted

In SQL, limit m, n says to start with the "m-th" eligible record, and return "n" records. Obviously, -40 is not a valid record number (should be 0 or higher). Are you using an ancient version of osC? Make sure that in admin/includes/classes/split_page_results.php (and also includes/classes/split_page_results.php), the following line

 $sql_query .= " limit " . offset . ", " . $max_rows_per_page;

is updated to

 $sql_query .= " limit " . max($offset, 0) . ", " . $max_rows_per_page;

 

If your osC is pre-2.2 MS2, you should seriously think about updating. You have hordes of security holes in your system that hackers will exploit.

Archived

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

×
×
  • Create New...