Jump to content

ALTER ADD et DROP


Recommended Posts

j'utilise bien

Db::getInstance()->execute('...');

pour créer une table, voici un exemple:

function installDB()
{ $return = true;
   $return &= Db::getInstance()->Execute('
   CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'bgshop` (
 `id_shop` varchar(255) NULL,
 `file-name` varchar(255) NULL,
 UNIQUE KEY `index_unique_bgshop_id_shop` (`id_shop`)
   )ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8 ;');
 $return &= Db::getInstance()->Execute('
   CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'bgcat` (
 `id_cat` varchar(255) NULL,
 `file-name` varchar(255) NULL,
 UNIQUE KEY `index_unique_bgcat_id_cat` (`id_cat`)
   )ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8 ;');
  return $return;
}

par contre je voudrais ajouter une ligne supplémentaire dans la table catégorie et shop, j'ai pas trouvé l'exemple très parlant

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...