une table commandes
Code : Tout sélectionner
CREATE TABLE commandes (
id tinyint(10) NOT NULL auto_increment,
id_membre tinyint(10) default '0',
`date` date NOT NULL default '0000-00-00',
heure time NOT NULL default '00:00:00',
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Code : Tout sélectionner
CREATE TABLE article_commande (
id tinyint(10) NOT NULL auto_increment,
id_commandes tinyint(10) NOT NULL default '0',
designation text NOT NULL,
nom text NOT NULL,
qte tinyint(11) NOT NULL default '0',
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
voici mon code :
$sql="select id from commandes where id_membre='$id_membre'";
$req=mysql_query($sql);
$row = mysql_fetch_assoc($req);
$id_commandes= $row['id'];
mais j'ai un problème puisque le nombre que j'obtiens pour id_commande est inférieur de 1 à l'id de commandesmerci