Dysan
11-23-2007, 11:05 AM
Why do I get the following error message, when output items from the database?
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Documents and Settings\User\Desktop\Xampp\htdocs\1.php on line 17
foreach($array as $item)
{
$result = mysql_query("SELECT * FROM names WHERE id = '$id'");
while($row = mysql_fetch_array($result)) //This is line 17
{
$row['Firstname']." - ". $row['Surname'] ." ".$row['Sex'];
}
}
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Documents and Settings\User\Desktop\Xampp\htdocs\1.php on line 17
foreach($array as $item)
{
$result = mysql_query("SELECT * FROM names WHERE id = '$id'");
while($row = mysql_fetch_array($result)) //This is line 17
{
$row['Firstname']." - ". $row['Surname'] ." ".$row['Sex'];
}
}