you could use mysql_affected_rows()..
something like this should do :
the ones you mentioned will work all the time I assume, because if the query failed, it will return 0 (False) !
so you may want to use empty() to make sure the value of $result is neither 0 (false) nor empty ..
so something like this should work :