0) $this->charger_id($id); } function init(){ $query = "CREATE TABLE `codepromo` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nom` varchar(50) NOT NULL, `description` text NOT NULL, `action` varchar(100) NOT NULL, `valeur` float NOT NULL, `code` varchar(100) NOT NULL, `statut` smallint(6) NOT NULL, PRIMARY KEY (`id`) ) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"; $resul = mysql_query($query, $this->link); } function charger($code){ return $this->getVars("select * from $this->table where code=\"$code\""); } function charger_id($id){ return $this->getVars("select * from $this->table where id=\"$id\""); } function charger_statut($code, $statut){ return $this->getVars("select * from $this->table where code='$code' AND statut IN(" . implode(",", $statut) . ")"); } } ?>