...

View Full Version : mysql_fetch_assoc



urgido
06-11-2007, 07:26 AM
$userM=$_SESSION['gid'];
$checkMSG="SELECT id,recipient,subject,body,emailed,sender,unread,folder FROM gid_msg WHERE recipient='$userM'";
$res=mysql_query(mysql_query);

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


ERROR:
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?
Regards:confused:

_Aerospace_Eng_
06-11-2007, 07: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());

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum