Jump to content

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result reso


louis_coetzee

Recommended Posts

Hi, I get the error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\eliteacc\lib\database.php on line 45

# Finds one product by id.
# Returns Array.
function find_listing($id)
{
	db_connect();
	$query = sprintf("SELECT * FROM listing where listing.id = '%s'", mysql_real_escape_string($id));
	$result = mysql_query($query);
	$row = mysql_fetch_array($result);
	return $row;
}

You have an error in the query and mysql_query() returned false instead of result resource. Use MySQL error reporting functions to get to know more.

 

Thanks, stupid mistake in query. Solved.

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.