wstar Posted August 6, 2015 Share Posted August 6, 2015 We have two installs of Prestashop 1.6 on two different servers. When we try to add a attribute to any product, we get this error. Column 'id_product' in where clause is ambiguous UPDATE ps_product_attribute a INNER JOIN ps_product_attribute_shop product_attribute_shop ON (product_attribute_shop.id_product_attribute = a.id_product_attribute AND product_attribute_shop.id_shop IN (2, 1)) SET a.default_on = '0', product_attribute_shop.default_on = '0' WHERE id_product = 82097 Anyone have ideas on how to fix this? Link to comment Share on other sites More sharing options...
stopher Posted August 6, 2015 Share Posted August 6, 2015 HI, you must specify the table name ( or alias, so in your case : a.id_product or product_attribute_shop.id_product )As exemple your query became : UPDATE ps_product_attribute a INNER JOIN ps_product_attribute_shop product_attribute_shop ON (product_attribute_shop.id_product_attribute = a.id_product_attribute AND product_attribute_shop.id_shop IN (2, 1)) SET a.default_on = '0', product_attribute_shop.default_on = '0' WHERE a.id_product = 82097 Ch. Link to comment Share on other sites More sharing options...
wstar Posted August 6, 2015 Author Share Posted August 6, 2015 I'm aware what the issue is, but why is Prestashop doing this? We have not added or changed any code. Also, I'm not even sure where the code is which generates this query. Link to comment Share on other sites More sharing options...
stopher Posted August 6, 2015 Share Posted August 6, 2015 Ok , you have the same mysql version onto your servers ? Maybe you can enable the debug mode to find what part of code generates this issue . Ch. Link to comment Share on other sites More sharing options...
stopher Posted August 6, 2015 Share Posted August 6, 2015 What version of prestashop you use ? Ch. Link to comment Share on other sites More sharing options...
wstar Posted August 6, 2015 Author Share Posted August 6, 2015 Thanks for the reply.Prestastop is running 1.6.1 MySQL is 5.5.40 Prestashop is in debug mode which is giving me the above error. Link to comment Share on other sites More sharing options...
wstar Posted August 7, 2015 Author Share Posted August 7, 2015 (edited) Still having this issue and I can not find an answer. I'm getting two errors. I get this error if I do NOT select the attribute combination as default Field 'id_product' doesn't have a default value INSERT INTO `ps_product_attribute_shop` (`id_product_attribute`, `wholesale_price`, `price`, `ecotax`, `weight`, `unit_price_impact`, `minimal_quantity`, `default_on`, `available_date`, `id_shop`) VALUES ('54946', '0', '0', '0', '0', '0', '1', '0', '0000-00-00', '2') Then I get this error if I do select the attribute combination as default Column 'id_product' in where clause is ambiguous UPDATE ps_product_attribute a INNER JOIN ps_product_attribute_shop product_attribute_shop ON (product_attribute_shop.id_product_attribute = a.id_product_attribute AND product_attribute_shop.id_shop IN (2, 1)) SET a.default_on = '0', product_attribute_shop.default_on = '0' WHERE id_product = 82098 I know what the errors mean but why is prestashop giving me these errors when adding a attribute combination to a product in the admin section? I do not even know which file is generating the SQL code to even look. Any help please? Little history: We have a testing server we used. We got the store going and moved it to another sever. Following the directions on these forums we moved it and everything works fine. This is the only issue we are having. Edited August 7, 2015 by wstar (see edit history) Link to comment Share on other sites More sharing options...
wstar Posted August 10, 2015 Author Share Posted August 10, 2015 Anyone have any ideas? I really need any ideas or help on the matter. Link to comment Share on other sites More sharing options...
wstar Posted August 11, 2015 Author Share Posted August 11, 2015 We fixed the issue by a complete reinstall and imported the old database. Thanks for the help. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now