Pb avec la commande mysql_fetch_assoc()
Bonjour à tous,
J'ai créer le code suivant :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
include("librairies/connexion.php");
$sql_annonce1 ='SELECT *
FROM annonce';
$req_annonce1 = mysql_query($sql_annonce1) or die('Erreur SQL !<br />'.$sql_annonce1.'<br />'.mysql_error());
$row = mysql_fetch_assoc($sql_annonce1);
print("<tr>");
while ($row)
{
$annonce_id = $row['AC_ID'];
$annonce_nom_zone = $row['ZN_LIB'];
$annonce_nom_categorie = $row['CT_LIB'];
$annonce_titre = $row['AC_TITRE'];
$annonce_design = $row['AC_Design'];
print ("<td>$annonce_id</td>
<td>$annonce_nom_zone</td>
<td>$annonce_nom_categorie</td>
<td>$annonce_titre</td>
<td>$annonce_design</td>");
}
print("</tr>"); |
A l'exécution de ce code, j'obtient le message d'erreur suivant :
"Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\wamp\www\TestMapGrece\test1.php on line 10".
La ligne en question est : $row = mysql_fetch_assoc($sql_annonce1).
J'ai regardé dans différents forums mais je n'ai rien trouvé.
Pouvez-vous m'aider svp ?
Merci
Dimitri.