Could be any of the above. You should always check for errors from your mysql_query statement.
function db_query($sql)
{
$result = mysql_query($sql);
if (mysql_errno() == 0) return $result;
die ('SQL ERROR ' . mysql_error() . '<br />' . htmlspecialchars($sql));
}
$query = "SELECT this FROM that";
$result = db_query($query);
/* At this point you know the query was executed.
It might not have the expected results but at least mysql
did not choke on it
*/