Kikicoin |
Le 29/01/2007 à 23:09  |
|
Salut à tous,
Malgré avoir regardé des explications sur plusieurs pages, je n'arrive pas à trouver d'où vient le problème qui me donne toujours la même erreur : Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in test.php on line 17
Voici le code :
<html>
<head>
<title>Trier</title>
<head>
<body>
<table border="1" cellpadding="0" cellspacing="0">
<tr>
<th>Nom</th>
<th>Email</th>
</tr>
<?php
mysql_connect('localhost','root','') or die ("erreur de connexion");
mysql_select_db('rotaract_france') or die ("erreur de connexion base");
$result = mysql_query("SELECT nom,email FROM websites ORDER ASC BY nom");
mysql_close();
while($row = mysql_fetch_row($result))
{
$Nom = $row[1];
$Email = $row[2];
echo "<tr>\n
<td>$Nom</td>\n
<td>$Email</td>\n
</tr>\n";
}
?>
</tr>
</table>
</body>
</html>
|
Jeanluc |
Le 29/01/2007 à 23:19  |
|
Bonsoir, ne serait-ce pas ORDER BY nom ASC, et non ORDER ASC BY nom ?
ou bien $Nom = $row['nom']; au lieu de $Nom = $row[1];?
JeanLuc |
Kikicoin |
Le 29/01/2007 à 23:23  |
|
Bonsoir JeanLuc,
C'était exactement ca, merci beaucoup !
Je cherchais désespérément l'erreur aillleurs ....
Bonne soirée ! |
Jeanluc |
Le 29/01/2007 à 23:25  |
|
Heureux d'avoir servi Bonne soirée .. et bons codes
JeanLuc |