For this:
PHP Code:
$query = "SELECT * FROM adopts_owned_adoptables WHERE currentlevel < '5' and owner='$loggedinname' and isfrozen='no'";
$result = mysql_query($query);
$num = mysql_numrows($result);
Add after:
PHP Code:
echo "Number: ".$num."<br>";
At the top of the screen you should see Number: and then the number of adoptables that match that query. Is the number greater than 5 or does a number even appear?