Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

special catalog part does not work


melbournestory

Recommended Posts

My Special section in the Catalog part does not work, when I click on the special in the admin control panal. It keeps on showing the error message:

 

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

 

Is there anyone who can help me out?

 

Many thanks,

 

Cathy

Link to comment
Share on other sites

My Special section in the Catalog part does not work, when I click on the special in the admin control panal. It keeps on showing the error message:

 

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

 

Is there anyone who can help me out?

 

Many thanks,

 

Cathy

 

The problem has been resolved. no help is needed now.

Link to comment
Share on other sites

My Special section in the Catalog part does not work, when I click on the special in the admin control panal. It keeps on showing the error message:

 

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

 

Is there anyone who can help me out?

 

Many thanks,

 

Cathy

 

 

I have a very similar problem--how did you fix it?

 

Jim

Link to comment
Share on other sites

I have a very similar problem--how did you fix it?

 

Jim

 

actually there is nothing wrong with the SQL syntax, if you've got the same problem. The reason is that I deleted everything inside the special table in the database.

 

So in order to fix up the problem, you'd better use PHPMyadmin to go to My SQL database, then select Table "Special" and Insert one record into it. then the problem will be fixed.

Link to comment
Share on other sites

actually there is nothing wrong with the SQL syntax, if you've got the same problem. The reason is that I deleted everything inside the special table in the database.

 

So in order to fix up the problem, you'd better use PHPMyadmin to go to My SQL database, then select Table "Special" and Insert one record into it. then the problem will be fixed.

 

 

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

Once a record is added will it allow an edit or change to that product?

 

I have also noticed the same problem with the expected products.

Link to comment
Share on other sites

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

Once a record is added will it allow an edit or change to that product?

 

I have also noticed the same problem with the expected products.

The real problem is (plus cure):

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

limit -20, 20

http://www.oscommerce.com/community/bugs,1605

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

 

Problem:

 

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

 

Solution:

 

Line 67 in catalog/includes/classes/split_page_results.php must be changed from:

 

$this->sql_query .= " limit " . $offset . ", " . $this->number_of_rows_per_page;

 

to:

 

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

 

Line 38 in catalog/admin/includes/classes/split_page_results.php must be changed from:

 

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

 

to:

 

$sql_query .= " limit " . max($offset, 0) . ", " . $max_rows_per_page;

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...