I see queries taking two forms:
$result = mysql_query("SELECT * FROM table");
and
$result = mysql_query("SELECT * FROM table", $db);
where $db = a specified database connection string.
Both seems to work just fine, at least in my experience. Why would or wouldn't you want/need to include the "$db" string in your queries?