That means your query was rejected by MySQL for some reason, and thus returned boolean false instead of a query result resource. Add an if() condition to see if $result (or whatever variable you used for the mysql_query() return value) is false, and if so log or display the value of mysql_error() to find out what it didn't like. You might also want to include the query string in that debug info.
$result = mysql_query($sql);
if($result == false)
echo "<p class='error'>Oops! Database error.</p>";
// do your fetch and other processing with the query result....