M. Zeeshan Khan Bawany Posted March 23, 2014 Share Posted March 23, 2014 I have installed PS1.6 and edited Zones of my choice, now Localization>Countries page in BO gives this error: Bad SQL queryColumn 'zone' in order clause is ambiguous Help appreciated in advance. Link to comment Share on other sites More sharing options...
vekia Posted March 24, 2014 Share Posted March 24, 2014 please turn on error reporting, then you will see script with mysql query where the problem appears, it is first step in debug process and it is necessary Link to comment Share on other sites More sharing options...
sooroos Posted March 28, 2014 Share Posted March 28, 2014 I have reproduced this error [PrestaShopDatabaseException] Column 'zone' in order clause is ambiguous <pre> SELECT SQL_CALC_FOUND_ROWS a.`id_country`,b.name as name,`iso_code`,`call_prefix`,z.id_zone as zone,a.active as active , z.`name` AS zone FROM `ps160_country` a LEFT JOIN `ps160_country_lang` b ON (b.`id_country` = a.`id_country` AND b.`id_lang` = 2) LEFT JOIN `ps160_zone` z ON (z.`id_zone` = a.`id_zone`) WHERE 1 ORDER BY `zone` desc LIMIT 0,1000</pre> at line 623 in file classes/db/Db.php <pre> 617. WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97); 618. } 619. else if (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) 620. { 621. if ($sql) 622. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>'); 623. throw new PrestaShopDatabaseException($this->getMsgError()); 624. } 625. } 626. 627. /** </pre> Link to comment Share on other sites More sharing options...
intermediadorpopular Posted April 11, 2014 Share Posted April 11, 2014 I have reproduced this error [PrestaShopDatabaseException] Column 'zone' in order clause is ambiguous <pre> SELECT SQL_CALC_FOUND_ROWS a.`id_country`,b.name as name,`iso_code`,`call_prefix`,z.id_zone as zone,a.active as active , z.`name` AS zone FROM `ps160_country` a LEFT JOIN `ps160_country_lang` b ON (b.`id_country` = a.`id_country` AND b.`id_lang` = 2) LEFT JOIN `ps160_zone` z ON (z.`id_zone` = a.`id_zone`) WHERE 1 ORDER BY `zone` desc LIMIT 0,1000</pre> at line 623 in file classes/db/Db.php <pre> 617. WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97); 618. } 619. else if (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) 620. { 621. if ($sql) 622. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>'); 623. throw new PrestaShopDatabaseException($this->getMsgError()); 624. } 625. } 626. 627. /** </pre> Como consertou este erro? Link to comment Share on other sites More sharing options...
sooroos Posted April 11, 2014 Share Posted April 11, 2014 english please Link to comment Share on other sites More sharing options...
intermediadorpopular Posted April 11, 2014 Share Posted April 11, 2014 english please How you fixed it? Link to comment Share on other sites More sharing options...
sooroos Posted April 12, 2014 Share Posted April 12, 2014 No Link to comment Share on other sites More sharing options...
vekia Posted April 13, 2014 Share Posted April 13, 2014 hello sooroos due to the fact that you aren't author of this topic i have to ask something in addition that was asked before what prestashop version you use? Link to comment Share on other sites More sharing options...
intermediadorpopular Posted April 13, 2014 Share Posted April 13, 2014 hello sooroos due to the fact that you aren't author of this topic i have to ask something in addition that was asked before what prestashop version you use? If you can, put the solution, I have similar problem in 1.6 Link to comment Share on other sites More sharing options...
sooroos Posted April 13, 2014 Share Posted April 13, 2014 vekia, it is 1.6.0.5 Link to comment Share on other sites More sharing options...
vekia Posted April 13, 2014 Share Posted April 13, 2014 and you see this error when you're trying to open country "edit" page? Link to comment Share on other sites More sharing options...
sooroos Posted April 13, 2014 Share Posted April 13, 2014 yes. but first i think i have deleted a few Link to comment Share on other sites More sharing options...
dmarsh Posted July 22, 2014 Share Posted July 22, 2014 and you see this error when you're trying to open country "edit" page? I have the same problem and the error now appears as soon as I open Localization Countries. The error appeared when I clicked on the zone column to organize by the zone. Now I am unable to open it again to change it back to sort by country. Is there a way to reset the order by or better yet not have it throw an error for a simple form change? Link to comment Share on other sites More sharing options...
vekia Posted July 23, 2014 Share Posted July 23, 2014 what is your ps version? it will be necessary to define from what table variable zone is selected Link to comment Share on other sites More sharing options...
dmarsh Posted July 23, 2014 Share Posted July 23, 2014 Version 1.6.0.5 thanks. I found a rather inelegant solution by editing the AdminCountriesController.php and removed the order by zone command. There is probably a better solution or should be a patch so it doesn't error out when changing the sort order. 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