Hi,
I have just installed an existing website on a local server which I used to run a few years ago.
I am receiving the following error when trying to access any one of the "specials", "manufacturers", "reviews" or "products expected" in the admin area.The only thing which I can think of that has changed is the MySQL and PHP versions but after applying some fixes everything other than these pages seems to work.
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 '-6, 6' 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 -6, 6
[TEP STOP]
Unfortunately it has been 5 years since I last used osCommerce and am stuck with how to proceed.
Any tips would be genuinely appreciated.
Peter.
Latest News: (loading..)
SQL - Error 1064
Started by peterpil19, Jul 01 2011, 11:22
3 replies to this topic
#1
Posted 01 July 2011, 11:22
#2
Posted 01 July 2011, 16:14
Check in admin - configuration - maximum values
Make sure you have positive values in the different settings like:
Special Products, New Reviews etc
These affect how many products, reviews per page. I pretty sure you shouldn't have a -6 in your limit.
The rest of the query looks good to me.
Make sure you have positive values in the different settings like:
Special Products, New Reviews etc
These affect how many products, reviews per page. I pretty sure you shouldn't have a -6 in your limit.
The rest of the query looks good to me.
#3
Posted 01 July 2011, 16:24
This is probably the issue with the split_page_result class, compare yours to this:
https://github.com/osCommerce/oscommerce2/blob/master/catalog/includes/classes/split_page_results.php
Pay particular attention to
https://github.com/osCommerce/oscommerce2/blob/master/catalog/includes/classes/split_page_results.php#L67
https://github.com/osCommerce/oscommerce2/blob/master/catalog/includes/classes/split_page_results.php
Pay particular attention to
https://github.com/osCommerce/oscommerce2/blob/master/catalog/includes/classes/split_page_results.php#L67
The Dirty Little Secrets that no osCommerce template sellers want you to know...revealed...
Support is commercially available. The question is whether you value your business
highly enough to spend money on it.
For commercial support from known developers who support osCommerce
ethos, please post at http://forums.oscommerce.com/forum/79-commercial-support/
Support is commercially available. The question is whether you value your business
highly enough to spend money on it.
For commercial support from known developers who support osCommerce
ethos, please post at http://forums.oscommerce.com/forum/79-commercial-support/
#4
Posted 01 July 2011, 17:09
Thank you both for your prompt replies.
Ultimately the following resolved the issue:: http://forums.oscommerce.com/topic/144095-1064-you-have-an-error-in-your-sql-syntax/
Peter P.
Ultimately the following resolved the issue:: http://forums.oscommerce.com/topic/144095-1064-you-have-an-error-in-your-sql-syntax/
Peter P.














