[thelist] checking for empty vars in PHP
mort
manuel at netbustion.com
Fri Jan 3 12:44:01 CST 2003
El vie, 03-01-2003 a las 18:21, Tom Dell'Aringa escribió:
> There are no items in registry that match this $uid at all - I'm
> wondering if this means that the $row is empty, therefore it never
> enters the while loop? if(!$result) wouldn't catch it because it was
> a successful query and therefore has a resource, but there's no
> data..does that makes sense? If so, how could I modify my while to
> get the 'no items' to show?
mysql_num_rows() will help you here :-)
http://www.php.net/manual/en/function.mysql-num-rows.php
if (mysql_num_rows($result)>0){
echo "Bingo!";
}
else{
echo "No luck. Try again";
}
--
Un saludo
___________
mort
manuel en netbustion.com , logica en simplelogica.net
http://simplelogica.net <= Simplelógica, creación web
More information about the thelist
mailing list