Duozhasht Posted December 6, 2012 Share Posted December 6, 2012 Hi everyone, Im developing a module in Prestashop 1.5 with database. But the problem is: When i go to install the module, it says that wasnt installed properly. The install is here: public function install() { if (parent::install() == false OR !$this->registerHook('leftColumn')) return false; if (!$sql = file_get_contents(dirname(__FILE__).'/install.sql')) die(Tools::displayError('File install.sql is not readable')); $sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql); $sql = preg_split("/;\s*[\r\n]+/", $sql); foreach ($sql as $query) if ($query AND sizeof($query) AND !Db::getInstance()->execute(trim($query))) return false; return true http://papelariavelo...ias/install.sql Link to comment Share on other sites More sharing options...
tomerg3 Posted December 6, 2012 Share Posted December 6, 2012 Try to enable SQL debug in /config/config.inc.php line #29 You can also try to print the last SQL error using Db::getInstance()->getMsgError() Link to comment Share on other sites More sharing options...
Duozhasht Posted December 6, 2012 Author Share Posted December 6, 2012 I already activated the debug. But the error ocours when i try to install the module. I took off the FOREIGN KEY and works fine. I think the error is when i try to link the customer_id to table ps_customer Link to comment Share on other sites More sharing options...
tomerg3 Posted December 6, 2012 Share Posted December 6, 2012 it looks like the error is coming from the DB query, I gave you the code to debug it. Link to comment Share on other sites More sharing options...
Recommended Posts