Jump to content

Resource Boolean?


unemployment

Recommended Posts

How can I fix this error?

 

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given

 

function fetch_most_recent_fans($ctag)
{
$sql = "SELECT
			`company_fans`.`company_id`,
			`company_fans`.`user_id`,
			`company_fans`.`fan_date`,
			`companies`.`companytag`,
			`users`.`firstname`,
			`users`.`lastname`,
			`users`.`username`
		FROM `company_fans`
		LEFT JOIN `companies`
		ON `companies`.`companyid` = `company_fans`.`company_id`
		LEFT JOIN `users`
		ON `users`.`id` = `company_fans`.`user_id`
		WHERE `companies`.`companytag` = {ctag}
		ORDER BY `company_fans`.`fan_date` DESC
		LIMIT 10";

$query = mysql_query($sql);

$return = array();

while (($row = mysql_fetch_assoc($query)) !== false)
{
	$return[] = $row;
}

return $return;
}

Link to comment
https://forums.phpfreaks.com/topic/234113-resource-boolean/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.