I've always done it like this:
$count = mysql_num_rows( $result );
if( $count == 0 ) then doomething();
But there may be a better way..
In yours it appears you are testing for anything in mysql_num_rows($result)
and a value of 0 in mysql_num_rows($ret). I may be misundertanding you. Do
you mean
Maybe I am missing something but it seems you are doing things in a
potentially unreliable way.
Firstly... your sql statement in create.php
$query_update = "INSERT INTO pets (uid) SELECT uid FROM users WHERE
uid={$session["uid"]}";
could simply be
mysql_query("INSERT INTO pets SET uid = " . $