Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Admin Error with Manufacturers! Please Help!


mystifier_uk

Recommended Posts

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

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

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

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

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

Archived

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

×
×
  • Create New...