Determining if a value is returned from a MySQL database
Posted: Tue Aug 05, 2003 3:26 am
I originally posted this in the PHP-Normal forum, but since it relates to MySQL retreival, it may be better here. A number of posters on the PHP manual decry the empty() function based on their own usage, but I want to determine whether or not a string variable is returned from a database.
Am I correct in thinking that, for this purpose,
is the same as
and that, similarly,
and
are the same? What are the advantages/disadvantages of using one approach over the other?
Cheers
Am I correct in thinking that, for this purpose,
Code: Select all
if (empty($var)) {...Code: Select all
if (!$var) {...Code: Select all
if (!empty($var)) {...Code: Select all
if (!$var) {...Cheers