Possible Duplicate:
mysql_fetch_array() expects parameter 1 to be resource, boolean given in select
mysql_fetch_assoc() expects parameter 1 to be resource
I'm trying to fetch a single field from one table and add it to another.
This is my third day using MySQL/PHP so I'm having a little issue.
PHP throws an error expecting a resource but a string was given.
It's the auto incremented ID field from one table.
Basically, I pull the ID where the first name and last name match.
$query5 = "SELECT FROM ".$db_prefix."customer_det (`id`)
WHERE fname = '".$fname."'
AND lname = '".$lname."'";
$result5 = mysql_query($query5);
while($row = mysql_fetch_assoc($result5)){
$uid = $row['id'];
echo "$uid";
}
Error:
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given