Jump to content

supplied argument is not a valid MySQL result resource


satre

Recommended Posts

Hi,

 

I hope someone can help me with this... I'm trying to get data from a table and work with it row by row. Here's a snippet of the code:

$query  = "SELECT program, nickname, city, state, director, directoremail, title, coordinator, coordinatoremail FROM contact";
$result = mysql_query($query);

while($row = mysql_fetch_assoc($result))
{
    echo "Program :{$row['program']} <br>" .
          "{$row['city']}, {$row['state']} <br>" .
         "Nickname : {$row['nickname']} <br>" .
         "Director : Dr. {$row['message']} <br>" .
  "Coordinator : {$row['title']} {$row['message']} <br><br>";


$myemail = "[email protected]";
$director = $row['director'];
$coordinatortitle = $row['title'];
$coordinator = $row['coordinator'];
$programnickname = $row['nickname'];
$program = $row['program'];
$directoremail = $row['directoremail'];
$coordinatoremail = $row['coordinatoremail'];

 

And here's the error I get:

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/content... on line 33

 

(the closing bracket for the while statement is further down in the code)

 

Thanks for your help!

-Satre

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.