Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SQL syntax error


kroll

Recommended Posts

Can any one help me with the following error message and how to fix it:

 

Specials

 

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

 

[TEP STOP]

 

I have the latest version of MySQL!!!

 

Thanks in advance...

Peter

:)

Link to comment
Share on other sites

Thanks for the info Nacer.

It worked a treat.

 

I am still getting heaps of SQL errors. I have MySQL v5.0.15-nt. Another error that I get when I attempt to view a product in my catalogue is:

 

Let's See What We Have Here

 

 

1054 - Unknown column 'p.products_id' in 'on clause'

 

select count(p.products_id) as total from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '16'

 

[TEP STOP]

 

 

Any Ideas?

 

Peter :thumbsup

Link to comment
Share on other sites

Hi Nacer,

 

 

Thanks for the information leading me to the update site. I updated the the relevant files according to the update & now everything works just fine. Much appreciated.

 

Regards,

Peter

Link to comment
Share on other sites

  • 2 weeks later...
Check the following:

 

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

 

See under MySQL 5.0 Compatibility subtitle.

 

Regards,

 

Enjoy.

 

My error is slightly different:

 

1054 - Unknown column 'p.products_ship_price' in 'field list'

 

select p.products_ship_price, p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from products p, products_description pd, products_to_categories p2c where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = '0' order by pd.products_name

 

[TEP STOP]

 

 

Any help? Anyone?

Link to comment
Share on other sites

My error is slightly different:

 

1054 - Unknown column 'p.products_ship_price' in 'field list'

 

select p.products_ship_price, p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from products p, products_description pd, products_to_categories p2c where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = '0' order by pd.products_name

 

[TEP STOP]

Any help? Anyone?

 

 

Hi John,

 

The error messgage you are getting would appear to be consistent with not having upagraded to the latest version including updating the tables on MySQL. Follow the link below to obtain the answer to your question:

 

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

 

Peter

Link to comment
Share on other sites

Hi John,

 

The error messgage you are getting would appear to be consistent with not having upagraded to the latest version including updating the tables on MySQL. Follow the link below to obtain the answer to your question:

 

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

 

Peter

 

 

I now know why i received the above error and added the mysql line in the database. I have osCommerce 2.2-MS2. Is that the latest? The problem now is since php 4.3.10 requires registered globals off, since I added the registered global patch, the contrib above cannot work because it requires registered globals on. Does anyone know of a shipping module that will work with registered globals off? I think that may solve the problem.

Thanks

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...