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 = "me@myemail.com";
$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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.