Codice PHP:
$query "...";
$result mysql_query($query);
$rows mysql_num_rows($result);
if (
$rows 0) {
    
// FOUND
} else {
    
// NOT FOUND