Erreur argument sql_fetch_assoc mysql

Résolu/Fermé
nirvana ghost Messages postés 26 Date d'inscription samedi 4 avril 2009 Statut Membre Dernière intervention 11 avril 2009 - 8 avril 2009 à 13:50
nirvana ghost Messages postés 26 Date d'inscription samedi 4 avril 2009 Statut Membre Dernière intervention 11 avril 2009 - 8 avril 2009 à 14:29
Bonjour,
besoin d'aide je galère!!
je suis sure que c'est une erreur bête de ma part ligne 14 (en gras ) Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in c:\program files\easyphp\www\site web art mania\liste_matiere_premiere.php on line 14
AVEZ vous une idée en quoi ça consiste???????????
<html>
<head><title>Liste des matièe premières</title></head>
<body>
<?php
mysql_connect("localhost", "root", "") or die("La connexion au serveur a échoué");

mysql_select_db("art-mania") or die("La connexion à la base a échoué");

$requete="select * from type_matiere_premiere,matiere_premiere type_matiere_premiere.code_mat_pre=matiere_premiere.code_mat_pre";

$result=mysql_query($requete);

echo '<table border=1><tr><th>Identifiant</th><th>matière première</th><th>type matière première</th><th>couleur</th><th>Quantité en stock</th><th>prix TTC</th><th>Modification</th><th>Suppression</th></tr>';
while($ligne=mysql_fetch_assoc($result))
  echo '<tr><td><a href=Consulter.php?id='.$ligne["code_typ_mat_pre"].'>'.$ligne["code_typ_mat_pre"].'</a></td><td>'.$ligne["des_mat_pre"].'</td><td>'.$ligne["des_typ_mat_pre"].'</td><td>'.$ligne["couleur"].'</td><td><a href="Modifier.php?id='.$ligne["code_typ_mat_pre"].'">Modifier</a></td><td><a href="Supprimer.php?id='.$ligne["code_typ_mat_pre"].'">Supprimer</a></td></tr>';
echo '</table>';
mysql_close();
?>
<a href=stock_matiere_pre.php >Ajouter une matiere première</a>
</body>
</html>

merci!!
A voir également:

5 réponses

ThEBiShOp Messages postés 8378 Date d'inscription jeudi 22 mars 2007 Statut Contributeur Dernière intervention 8 février 2021 1 565
8 avril 2009 à 13:55
syntaxe d'un while :

while (condition) {
  instructions...;
}
0
nirvana ghost Messages postés 26 Date d'inscription samedi 4 avril 2009 Statut Membre Dernière intervention 11 avril 2009
8 avril 2009 à 14:03
puisqu'il s'agit d'une seule instruction il n'est nécessaire de mettre les {}...
0
ThEBiShOp Messages postés 8378 Date d'inscription jeudi 22 mars 2007 Statut Contributeur Dernière intervention 8 février 2021 1 565
8 avril 2009 à 14:05
essaye tout de même avec, sait-on jamais...
0
nirvana ghost Messages postés 26 Date d'inscription samedi 4 avril 2009 Statut Membre Dernière intervention 11 avril 2009
8 avril 2009 à 14:11
elle existe toujours et c'est la même erreur
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
nirvana ghost Messages postés 26 Date d'inscription samedi 4 avril 2009 Statut Membre Dernière intervention 11 avril 2009
8 avril 2009 à 14:29
salut ça a j'ai troué le blème il s'agit d'un where qui manquait
 $requete="select * from type_matiere_premiere,matiere_premiere where type_matiere_premiere.code_mat_pre=matiere_premiere.code_mat_pre";
0