PHP Mysql

Résolu
cs_nino69 Messages postés 29 Date d'inscription mardi 19 avril 2005 Statut Membre Dernière intervention 8 juillet 2005 - 7 mai 2005 à 15:05
cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 - 7 mai 2005 à 21:27
Bonjour, je désire extraire tous les id d'une table se rapportant à un client avec la fonction: mysql_fetch_array et foreach mais sans succès......
$query6 "SELECT jet_chantier.id_chantier FROM jet_chantier WHERE jet_chantier.id_clients'".$id_clients."'";

$result6 = mysql_db_query($dbName,$query6)or die ('Erreur : '.mysql_error());

$tabid6 = mysql_fetch_array($result6);

foreach ($tabid6 as $value){

echo $value."
";

}

3 réponses

cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 8
7 mai 2005 à 18:13
Salut,



$requete=mysql_query("SELECT jet_chantier.id_chantier FROM jet_chantier WHERE jet_chantier.id_clients ='".$id_clients."'");



while($r=mysql_fetch_row($requete))

{


echo $r[0],'
';


}


<hr size="2" width="100%">




<li>Entraide, dépannage et vulgarisation informatique: Mon site de vulgarisation informatique</li>
3
malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
7 mai 2005 à 20:49
Tu sais, Antho,
...row est plus rapide, fetch ...assoc est quand meme bien plus clair.
...array est a proscrire ceci dit! Totalement inutile.
3
cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 8
7 mai 2005 à 21:27
Bah peut-être plus clair mais bon...



quand on fait une reqûete propre on connait quel champ va avec quel numéro lol

<hr size="2" width="100%">




<li>Entraide, dépannage et vulgarisation informatique: Mon site de vulgarisation informatique</li>
0
Rejoignez-nous