N@D33M Posted August 23, 2013 Share Posted August 23, 2013 (edited) Hi, Whenever I edit the tax rule for Canada, I always get this error: Bad SQL query Column 'name' in where clause is ambiguous even though in database I could see the records has already been inserted, I tried many different method and eventually found, this is a glitch in this project, if any senior could shed a light on this issue or I'm the only one who is experiencing this issue? Quick help would be much appreciate! Nadeem Edited August 23, 2013 by N@D33M (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted August 23, 2013 Share Posted August 23, 2013 please turn on error reporting: http://www.prestashop.com/forums/topic/224525-how-to-get-debug-information-for-500-error-or-blank-page/ then you will see a bit more information in which query you've got this issue, then i will be able to say something more what you have to change Link to comment Share on other sites More sharing options...
N@D33M Posted August 26, 2013 Author Share Posted August 26, 2013 (edited) please turn on error reporting: http://www.prestasho...-or-blank-page/ then you will see a bit more information in which query you've got this issue, then i will be able to say something more what you have to change Thanks Vekia, Here is the test case: - Created a new Tax Rule with name Canada1 - Access the Tax Rule listing page - Search the can to filter out the result to see only records having can - Now click the searched record and it gives something like that error. SELECT SQL_CALC_FOUND_ROWS a.* , c.`name` AS country_name, s.`name` AS state_name, CONCAT_WS(" - ", a.`zipcode_from`, a.`zipcode_to`) AS zipcode, t.rate FROM `ps_tax_rule` a LEFT JOIN `ps_country_lang` c ON (a.`id_country` = c.`id_country` AND id_lang = 1) LEFT JOIN `ps_state` s ON (a.`id_state` = s.`id_state`) LEFT JOIN `ps_tax` t ON (a.`id_tax` = t.`id_tax`) WHERE 1 AND `id_tax_rules_group` = 61 AND `name` LIKE '%can%' ORDER BY id_tax_rules_group ASC LIMIT 0,50 It's Glitch to my knowledge. If you don't set any filter and simply go to next page and click any record, it will show the desired results. Edited August 26, 2013 by N@D33M (see edit history) Link to comment Share on other sites More sharing options...
w3bsolutions Posted July 24, 2014 Share Posted July 24, 2014 I am getting this error too on PS 1.6.0.8, did you manage to find the problem? Link to comment Share on other sites More sharing options...
Isbj0rn Posted November 28, 2014 Share Posted November 28, 2014 (edited) I am having exactly the same problem. Solution needed Looking at the DB, I can not find a.aktive. So its refering to a column that is non existing. When saving new tax rule I get: Bad SQL queryUnknown column 'a.active' in 'where clause' Edited November 28, 2014 by Isbj0rn (see edit history) Link to comment Share on other sites More sharing options...
SHU Technologies Posted January 22, 2015 Share Posted January 22, 2015 I have exaclty the same problem, when I click on "tax rules in backoffice" this message I get: Bad SQL queryUnknown column 'a.deleted' in 'where clause' If I want to create a new Tax rule and when I want to save then I get this error message: An error occurred while creating an object. tax_rules_group (Unknown column 'deleted' in 'field list') I saw in a spanish thread similar problem but I did not understand the solution. Anybody with a solution? Thanks Link to comment Share on other sites More sharing options...
magick98 Posted February 9, 2015 Share Posted February 9, 2015 I have exaclty the same problem, when I click on "tax rules in backoffice" this message I get: Bad SQL queryUnknown column 'a.deleted' in 'where clause' If I want to create a new Tax rule and when I want to save then I get this error message: An error occurred while creating an object. tax_rules_group (Unknown column 'deleted' in 'field list') I saw in a spanish thread similar problem but I did not understand the solution. Anybody with a solution? Thanks Hello. I get the exact same error - did you solve it? How? Link to comment Share on other sites More sharing options...
SHU Technologies Posted February 10, 2015 Share Posted February 10, 2015 Yes I could solve it. I logged in to my hosting provider then in cPanel I went to phpMyAdmin. There i run the following SQL command: ALTER TABLE `PREFIX_tax_rules_group` ADD `deleted` TINYINT(1) UNSIGNED NOT NULL, ADD `date_add` DATETIME NOT NULL, ADD `date_upd` DATETIME NOT NULL; ALTER TABLE `PREFIX_order_detail` ADD `id_tax_rules_group` INT(11) UNSIGNED DEFAULT '0' AFTER `product_weight`, ADD INDEX `id_tax_rules_group` (`id_tax_rules_group`); You should replace in this command the PREFIX_ with your database prefix in my case it is PS_ (Ithink that is the default Prestashop prefix.) This command alter the tax rule table and adds the "deleted" field if it not exists. After I ran this I got back even all the pre-installed tax rules as well and was able to create new ones. Hope it works for you too. Good luck Link to comment Share on other sites More sharing options...
magick98 Posted February 11, 2015 Share Posted February 11, 2015 (edited) Yes I could solve it. I logged in to my hosting provider then in cPanel I went to phpMyAdmin. There i run the following SQL command: ALTER TABLE `PREFIX_tax_rules_group` ADD `deleted` TINYINT(1) UNSIGNED NOT NULL, ADD `date_add` DATETIME NOT NULL, ADD `date_upd` DATETIME NOT NULL; ALTER TABLE `PREFIX_order_detail` ADD `id_tax_rules_group` INT(11) UNSIGNED DEFAULT '0' AFTER `product_weight`, ADD INDEX `id_tax_rules_group` (`id_tax_rules_group`); You should replace in this command the PREFIX_ with your database prefix in my case it is PS_ (Ithink that is the default Prestashop prefix.) This command alter the tax rule table and adds the "deleted" field if it not exists. After I ran this I got back even all the pre-installed tax rules as well and was able to create new ones. Hope it works for you too. Good luck It work again now. Thanks very much! But how do I get it to show the VAT in the shopping cart? Can anyone here help, please? Edited February 11, 2015 by magick98 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts