Problème avec liste mltiligne en php

Fermé
black-ice-50 Messages postés 13 Date d'inscription mardi 12 mai 2009 Statut Membre Dernière intervention 6 juin 2009 - 19 mai 2009 à 12:43
pyschopathe Messages postés 1973 Date d'inscription dimanche 2 mars 2008 Statut Membre Dernière intervention 22 mars 2010 - 19 mai 2009 à 13:18
Bonjour,
j'utilise le code ci dessous & php m'affiche une liste vide sachant que j'ai tester ma requette sur mysql est ça marche

<?php
if(isset($_POST['Submit'])&& isset($_POST['client'])){
$client=$_POST['client'];
$s=" SELECT * FROM livraison,commande where livraison.idLiv=commande.idLiv and commande.code_Client='".$client."'and livraison.id_etat_f= 0 ";
$x=mysql_query($s);
if($x)$m=1;
echo $x;
}

?>

<form id="form2" name="form2" method="post" action="">

<select name="lbl" size="9" id="select2">
<?php
while ($t = mysql_fetch_array($x)) {

?>
<option value="<?php echo $t['id_cmd']?>">
<?php echo $t['id_cmd']." "."l&h"; ?>
</option>
<?php
}


?>
</select>


merci d'avance
A voir également:

1 réponse

pyschopathe Messages postés 1973 Date d'inscription dimanche 2 mars 2008 Statut Membre Dernière intervention 22 mars 2010 135
19 mai 2009 à 13:18
Essaie ça :
while ($t = mysql_fetch_array( $x, MYSQL_ASSOC )) {  
  echo '<pre>';
  print_r( $t );
  echo'</pre>';
}
Ca devrait t'afficher le tuple, ça te permettra d'identifier d'éventuelles erreurs...
1