Page 1 of 1

mysql_query(): supplied argument is not a valid MySQL-Link

Posted: Wed Nov 29, 2006 5:33 am
by tolearn
Hi,

Im trying to update some values in database and the code goes like this

$sql = "UPDATE tbl_users SET status='$sta' WHERE user_ID=$user_id";
if (!mysql_query($sql,$con))
{
die('Could not update table tbl_users: ' . mysql_error());
}

But while execueting im getting a message

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/ffinders/public_html/working_files/member_confirm_posted.php on line 286
Could not update table tbl_users:

Help me.What's wrong in this.

Posted: Wed Nov 29, 2006 5:59 am
by aaronhall
Use single quotes around $user_id

Posted: Wed Nov 29, 2006 6:28 am
by volka
$con is no mysql connection resource.
Do you check the return value of mysql_connect?