Hey guys, I hope you're doing well.
I was following the user profile tutorial and i'm getting an error message which I can't figure out.
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\user_system\core\inc\user.inc.php on line 31
I understand that it expects a resource and it's receiving a boolean value I just don't understand why.
[syntax=php]
//fetches profile information for the given user.
function fetch_user_info($uid) {
$uid = (int)$uid;
$sql = "SELECT
`user_username` AS `username`,
`user_firstname` AS `firstname`,
`user_lastname` AS `lastname`,
`user_email` AS `email`,
`user_about` AS `about`,
`user_location` AS `location`,
`user_gender` AS `gender`,
FROM `users`
WHERE `user_id` = {$uid}";
$result = mysql_query($sql);
return mysql_fetch_assoc($result);
}
[/syntax]
User profile tutorial
Re: User profile tutorial
Try removing the , from `gender`,