Jump to content

[SOLVED] SQL Error with manufacturers and suppliers 1.2.1


Recommended Posts

Hi I' m working on a site www.rockingheads.com powered by PS 1.2.1 and everything works just fine except with manufacturers and suppliers. Each time I select one of them I get this error:

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 '-10,10' at line 16


SELECT p.*, pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, i.`id_image`, il.`legend`, m.`name` AS manufacturer_name, tl.`name` AS tax_name, t.`rate`
FROM `ps_product` p
LEFT JOIN `ps_product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = 3)
LEFT JOIN `ps_image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1)
LEFT JOIN `ps_image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = 3)
LEFT JOIN `ps_tax` t ON t.`id_tax` = p.`id_tax`
LEFT JOIN `ps_tax_lang` tl ON (t.`id_tax` = tl.`id_tax` AND tl.`id_lang` = 3)
LEFT JOIN `ps_manufacturer` m ON m.`id_manufacturer` = p.`id_manufacturer`
LEFT JOIN `ps_category_product` cp ON (cp.`id_product` = p.`id_product`)
INNER JOIN `ps_category_group` ctg ON (ctg.`id_category` = cp.`id_category`)

WHERE p.`id_manufacturer` = 4 AND p.`active` = 1
AND ( ctg.`id_group` = 1)
GROUP BY p.`id_product`
ORDER BY `name` DESC
LIMIT -10,10

I read that this problem might occur when transfering from local to remote, but this is not the case since I've been building my site from scratch directly on the host. I tried to erase all data in the manufacturers & suppliers, I even cancelled everything and restarted site and db from the beginning: I still get that error. I then made a replica of my site on my pc inside a wamp server and everything worked fine. Could it be due to MySQL version (5.0.62) on my host?
Please, any help will be highly appreciated
best regards
Alberto

Link to comment
Share on other sites

One more thing....it seems like a weird behaviour, but I found out that if I put a temporary price to a product, select a manufacturer and/or a supplier and save the data, then put it back to 0,00 the error disappears. Does it mean that if I have a non-profit company I still have to lay down some prices and then erase them to make it work? It's funny but anyway the problem's gone.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...