CloudCyberSystems Posted April 5, 2015 Share Posted April 5, 2015 (edited) I'm getting The following module(s) could not be installed properly: xmlapi : Here is my install code. Whats wrong with it? public function installDB() { return Db::getInstance()->execute(' CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'xmlapi` `xml_service_id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `xml_service_customer_code` VARCHAR(255) NOT NULL, `xml_service_user_id` VARCHAR(255) NOT NULL, `xml_service_login_key` VARCHAR(255) NOT NULL, PRIMARY KEY (`xml_service_id`) ) DEFAULT CHARSET=utf8;'); } public function install() { /* Config values and register */ $languages = $this->getAvailableLanguages($this->id_shop); $homecat = array(); if (!parent::install() || !$this->installDB() ) return false; return true; } I've also tried public function install() { /* Config values and register */ $languages = $this->getAvailableLanguages($this->id_shop); $homecat = array(); if (!parent::install() || !$this->installDB() ) return false; return true; } public function installDB() { return Db::getInstance()->execute(' CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'xmlapi` `xml_service_id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `xml_service_customer_code` VARCHAR(255) NOT NULL, `xml_service_user_id` VARCHAR(255) NOT NULL, `xml_service_login_key` VARCHAR(255) NOT NULL, PRIMARY KEY (`xml_service_id`) ) DEFAULT CHARSET=utf8;'); } Edited April 5, 2015 by CloudCyberSystems (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted April 6, 2015 Share Posted April 6, 2015 (edited) First of all, make sure your code is syntax error free: public function installDB(){return Db::getInstance()->execute(' CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'xmlapi` ( <-- `xml_service_id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `xml_service_customer_code` VARCHAR(255) NOT NULL, `xml_service_user_id` VARCHAR(255) NOT NULL, `xml_service_login_key` VARCHAR(255) NOT NULL, PRIMARY KEY (`xml_service_id`) ) DEFAULT CHARSET=utf8;');} some tools: http://www.piliapp.com/mysql-syntax-check/ http://phpcodechecker.com/ My 2 cents, pascal Edited April 6, 2015 by PascalVG (see edit history) Link to comment Share on other sites More sharing options...
CloudCyberSystems Posted April 6, 2015 Author Share Posted April 6, 2015 (edited) Nope still getting the same error now.... heres my code... Again both (http://www.piliapp.c...l-syntax-check/ http://phpcodechecker.com/) are showing no errors..... public function install() { /* Config values and register */ $languages = $this->getAvailableLanguages($this->id_shop); $homecat = array(); if (!parent::install() || !$this->installDB() ) return false; return true; } public function installDB() { return Db::getInstance()->execute(' CREATE TABLE `'._DB_PREFIX_.'xmlapi` ( `xml_service_id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `xml_service_customer_code` VARCHAR(255) NOT NULL, `xml_service_user_id` VARCHAR(255) NOT NULL, `xml_service_login_key` VARCHAR(255) NOT NULL, PRIMARY KEY (`xml_service_id`) ) DEFAULT CHARSET=utf8;'); } Edited April 6, 2015 by CloudCyberSystems (see edit history) Link to comment Share on other sites More sharing options...
CloudCyberSystems Posted April 6, 2015 Author Share Posted April 6, 2015 SOLVED!for anyone else having this problem here is the working code public function install() { /* Config values and register */ $languages = $this->getAvailableLanguages($this->id_shop); $homecat = array(); if (!parent::install() || !$this->installDB() ) return false; return true; } public function installDB() { return Db::getInstance()->execute(' CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'xmlapi` ( `xml_service_id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `xml_service_customer_code` VARCHAR(255) NOT NULL, `xml_service_user_id` VARCHAR(255) NOT NULL, `xml_service_login_key` VARCHAR(255) NOT NULL, INDEX (`xml_service_id`) ) DEFAULT CHARSET=utf8;'); } public function uninstall() { if (!parent::uninstall() || !$this->uninstallDB() ) return false; return true; } public function uninstallDB() { return Db::getInstance()->execute(' DROP TABLE `'._DB_PREFIX_.'xmlapi`'); } 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