It means the query failed for whatever reason.
Use the mysql_error function to see specifically why.

PHP Code:
$result mysql_query($sql$db);

if (!
is_resource($result))
{
  die(
mysql_error());

Replace die() with some other logic in a production environment, of course.