As matt said, mysql_query() only fails if the query was invalid.
$sql = "SELECT tableid FROM table where row2 = value";
if($result = mysql_query($sql)
{
// Give a warning about a failed query
}
else
{
if (!mysql_num_rows($result) == 0)
{
// Give a 'zero results' warning
}
else
{
// Play with results from query
}
}
A forum, a FAQ, what else do you need?