View Full Version : mysql_fetch_assoc

06-11-2007, 06:26 AM
$checkMSG="SELECT id,recipient,subject,body,emailed,sender,unread,folder FROM gid_msg WHERE recipient='$userM'";

while($fila = mysql_fetch_assoc($res)) {
echo $fila["subject"];

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in *********** on line 11

My line 11 is:

while($fila = mysql_fetch_assoc($res)) {

What's wrong?

06-11-2007, 06:35 AM
You should use die on this line

$res=mysql_query(mysql_query) or die(mysql_error());
and also you pass mysql_query to the mysql_query function which is incorrect. That line should be

$res=mysql_query($checkMSG) or die(mysql_error());

06-11-2007, 07:34 AM
all solved. Thanks

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum