User profile tutorial

Post here is you are having problems with any of the tutorials.
Post Reply
salrathor1
Posts: 26
Joined: Tue Jun 21, 2011 2:23 am

User profile tutorial

Post by salrathor1 »

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.
//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);
			
}
icey2k
Posts: 16
Joined: Mon Jul 04, 2011 4:26 pm

Re: User profile tutorial

Post by icey2k »

Try removing the , from `gender`,
Post Reply