Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

1064 - You have an error in your SQL syntax


Guest

Recommended Posts

Hi there.. I have done a search on the above error but the scenarios that the other problems occured are different to mine so not too sure on how to fix this.. Basically i deleted all the items out of the specials section in the admin area and then received the following error when clicking on the specials part of my website..

 

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 '-9, 9' at line 1

 

select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from products p, products_description pd, specials s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and s.status = '1' order by s.specials_date_added DESC limit -9, 9

 

[TEP STOP]

 

 

From the other posts it seems like it might be a simple fix but i have no idea where to start looking?! So any help would be greatly appreciated..

 

Thx

Simon

Link to comment
Share on other sites

I too am having this problem after my server startlogic moved and updated the sql. have been trying to contact them for 2 days with no result.

 

Specials (on the admin page)

 

Products Products Price Status 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 '-20, 20' at line 1

 

select p.products_id, pd.products_name, p.products_price, s.specials_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, s.date_status_change, s.status from products p, specials s, products_description pd where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = s.products_id order by pd.products_name limit -20, 20

 

and this error on the website:

http://www.thegifthaven.com/Store/catalog/specials.php

 

 

 

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 '-9, 9' at line 1

 

select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from products p, products_description pd, specials s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and s.status = '1' order by s.specials_date_added DESC limit -9, 9

 

[TEP STOP]

 

Also in the admin page;

 

Manufacturers

 

Manufacturers 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 '-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

 

[TEP STOP]

Link to comment
Share on other sites

in split page class.

function splitPageResults replace last line with this.

$this->sql_query .= " limit " . max($offset, 0) . ", " . $this->number_of_rows_per_page;

 

max($offset, 0) is needed as negetive values are not taken by mysql5.

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

At the very least you need to upgrade your osc. You can upgrade to the rc2a but beware some people have problems with certain contribs working on that.

These 2 links are an absolut to upgrade to

 

http://www.oscommerce.com/ext/update-20051113.html

 

http://www.oscommerce.com/ext/update-20060817.html

 

I have already updated the OsCommerce. These errors happened after Startlogic updtated their sql to ver 5.

Link to comment
Share on other sites

in split page class.

function splitPageResults replace last line with this.

$this->sql_query .= " limit " . max($offset, 0) . ", " . $this->number_of_rows_per_page;

 

max($offset, 0) is needed as negetive values are not taken by mysql5.

 

Satish

 

After finding out where the file was it works great! Thanks for your help :)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...