Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

1064 - You have an error in your SQL syntax,


daskog

Recommended Posts

After moving my site to a new webhost and doing som stuff i got this 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 '-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 = '4' and s.status = '1' order by s.specials_date_added DESC limit -9, 9

 

 

im aware about this post: http://www.oscommerce.com/forums/index.php?showtopic=144095&hl=

 

 

but sems to not work with my problem.

Any help is preciated i have no clue at all where this is coming frome and/or how to fix it

 

please let me know i wich files i have to find and edit allso any solution to the problem :)

Link to comment
Share on other sites

Is it on the catelog side or the admin?... and the only time I have seen this error mentioned the fix on that thread solved the problem Are you sure you did it correctly?

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

Did you apply the patch code to both admin AND catalog versions of split_results.php?

 

Tom

 

 

 

only to Admin split_results.php

 

Since i could not fint the same string of code in the catalog version i did not trye to edit it there.

Link to comment
Share on other sites

Is it on the catelog side or the admin?... and the only time I have seen this error mentioned the fix on that thread solved the problem Are you sure you did it correctly?

 

 

this problem is only on the user/store front as far as im aware of.

Have gone trough every menu to look for more trouble could not find any more...

Link to comment
Share on other sites

allso tryed to run this against the database:

 

drop table if exists specials;

create table specials (

specials_id int(11) not null auto_increment,

products_id int(11) default '0' not null ,

specials_new_products_price decimal(15,4) default '0.0000' not null ,

specials_date_added datetime ,

specials_last_modified datetime ,

expires_date datetime ,

date_status_change datetime ,

status int(1) default '1' not null ,

PRIMARY KEY (specials_id)

);

Link to comment
Share on other sites

You need to edit the catalog side version of the file.

 

edit /includes/classes/split_page_results.php

find

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

(line about 66)

insert before it

if($offset <0 ) $offset = 0;

 

HTH

Tom

 

Droping and recreating the table won't help. The problem only occurs when you have 0 rows in the table.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...