Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Error 1064


kohnhost

Recommended Posts

Getting a weird error in several areas of my catalog section:

 

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 manufacturers_id, manufacturers_name, manufacturers_image, date_added, last_modified from manufacturers order by manufacturers_name limit -6, 6

 

Any ideas?

Link to comment
Share on other sites

Yep, you have not applied the patches for your install of osc.

 

If I am correct patches to correct this are included with each release of Oscommerce and are generally in the extras directory. The files have names like update-yyyymmdd.html and update-yyyymmdd.txt.

 

These files contain a shed load of patches that should be applied to a stock install, but as this is not shown as a step in the documentation / installation instruction that I have read, most people won't until they run into a problem. Then they will find a solution to one problem via the forums.

 

Here is the index of my updates file.

 

osCommerce 2.2 Milestone 2 Update 051113

Update Package 13th November 2005

 

------------------------------------------------------------------------------

Table of Contents

------------------------------------------------------------------------------

 

## Update 051113

 

customer_country_id in addressbook

 

## Update 051112

 

Cannot re-assign $this

limit -20, 20

Database Input Enhancement

Adding Non-Existing Products To Cart

Session ID XSS Issue

Validate Session ID

File Manager Problem

HTTP Header Injection

E-Mail Header Injection

Contact Us Form XSS Issue

Open Redirector

Extra Slashes In New Products

Order Status Filtering

MySQL 5.0 Compatibility

 

This is a link to a later one

 

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

 

These threads might also be of use

 

http://www.oscommerce.com/community/contributions,4654

http://www.oscommerce.com/community/contributions,3727/

http://www.oscommerce.com/forums/index.php?showtopic=179130

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

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

  • 2 weeks later...

Im sorry but how do I install the updates? Do I have to do a fresh installation? Or do I have to upload a few files and overwrite the existing ones? If so which ones?

 

Sorry Im not used to this and have tried reading all of the post I found by searching on this error, but nothing helped. Tried changing the split_page_results.php page codes a bit as well as shown in some posts in this forum.. but again didnt help.

 

I still get the following error at the bottom of my main page:

--------------------------------------

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

 

select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from products p left join specials s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit

 

[TEP STOP]

---------------------------------------

Link to comment
Share on other sites

Im sorry but how do I install the updates? Do I have to do a fresh installation? Or do I have to upload a few files and overwrite the existing ones? If so which ones?

 

Sorry Im not used to this and have tried reading all of the post I found by searching on this error, but nothing helped. Tried changing the split_page_results.php page codes a bit as well as shown in some posts in this forum.. but again didnt help.

 

I still get the following error at the bottom of my main page:

--------------------------------------

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

 

select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from products p left join specials s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit

 

[TEP STOP]

---------------------------------------

 

 

Hi Please do the following to help you resolve this issue

 

To fix this

 

In admin/includes/classes find split_page_results.php and - BACK IT UP then find the lines

 

$offset = ($max_rows_per_page * ($current_page_number - 1));

$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

 

change to

 

$offset = ($max_rows_per_page * ($current_page_number - 1));

if ($offset < 0)

{

$offset = 0 ;

}

$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

 

This will resove your issue

 

Cheers

 

Graham

Link to comment
Share on other sites

Hi Please do the following to help you resolve this issue

 

To fix this

 

In admin/includes/classes find split_page_results.php and - BACK IT UP then find the lines

 

$offset = ($max_rows_per_page * ($current_page_number - 1));

$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

 

change to

 

$offset = ($max_rows_per_page * ($current_page_number - 1));

if ($offset < 0)

{

$offset = 0 ;

}

$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

 

This will resove your issue

 

Cheers

 

Graham

 

 

Sorry just read your post properly you say you have tried the aboe fix, could you paste in the complete copy of split_page_results.php

 

Cheers

Link to comment
Share on other sites

  • 3 weeks later...

Archived

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

×
×
  • Create New...