mystifier_uk Posted November 15, 2005 Share Posted November 15, 2005 I tried editing the 'Manufacturers' in the admin area, so I deleted them one by one and intended to insert new ones but after I deleted the last manufacturer from the page it comes up with the error message: Manufacturers 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 manufacturers_id, manufacturers_name, manufacturers_image, date_added, last_modified from manufacturers order by manufacturers_name limit -20, 20 And it won't allow me to add a new manufacturer! Please help me! Link to comment Share on other sites More sharing options...
namynot Posted November 15, 2005 Share Posted November 15, 2005 This fix helped me with errors on "admin/specials.php" and a few other pages. I used this code and it worked. Backup admin/includes/classes/split_page_results.php Find $offset = ($this->number_of_rows_per_page * ($this->current_page_number - 1)); $this->sql_query .= " limit " . $offset . ", " . $this->number_of_rows_per_page; Replace with $offset = ($max_rows_per_page * ($current_page_number - 1)); if ($offset < 0) { $offset = 0 ; } $sql_query .= " limit " . $offset . ", " . $max_rows_per_page; ------- This should get you running... Link to comment Share on other sites More sharing options...
Guest Posted November 15, 2005 Share Posted November 15, 2005 I tried editing the 'Manufacturers' in the admin area, so I deleted them one by one and intended to insert new ones but after I deleted the last manufacturer from the page it comes up with the error message: Manufacturers 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 manufacturers_id, manufacturers_name, manufacturers_image, date_added, last_modified from manufacturers order by manufacturers_name limit -20, 20 And it won't allow me to add a new manufacturer! Please help me! I had this as well it appears you cannot delete all the manufactures, simply restore your database, add a new manufacturer before deleting the unwanted manufacturers. Link to comment Share on other sites More sharing options...
mystifier_uk Posted November 15, 2005 Author Share Posted November 15, 2005 Thanks for your quick reply! But I'm a newbie - how would I restore the database? Link to comment Share on other sites More sharing options...
cjfowler Posted November 19, 2005 Share Posted November 19, 2005 This fix helped me with errors on "admin/specials.php" and a few other pages. I used this code and it worked. Backup admin/includes/classes/split_page_results.php Find $offset = ($this->number_of_rows_per_page * ($this->current_page_number - 1)); $this->sql_query .= " limit " . $offset . ", " . $this->number_of_rows_per_page; Replace with $offset = ($max_rows_per_page * ($current_page_number - 1)); if ($offset < 0) { $offset = 0 ; } $sql_query .= " limit " . $offset . ", " . $max_rows_per_page; ------- This should get you running... Thanks! This was just what I needed tonight to fix a SQL error with the limit using a negative number in specials, manufacturers, reviews and products expected. * Approach the ordinary with extraordinary intent! * Link to comment Share on other sites More sharing options...
Guest Posted November 24, 2005 Share Posted November 24, 2005 Thanks Heaps for this fix! - I've been doing the add data to tables through phpadmin work around and never deleting all items from specials :) was a real pain for me and clients! Regards, H Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.