HOW CAN I DETECT A NULL IN A MYSQL QUERY
| From: | Marc Mu�oz Salvador | Date: | Tue, 08 Sep 1998 15:39:05 +0000 |
| Subject: | HOW CAN I DETECT A NULL IN A MYSQL QUERY | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-877@lists.php.net to get a copy of this message | ||
Hi all, this is Marc from Barcelona
I'd like to detect if a field froma a result of a mysql_query() is null.
I've been trying but I couldn't.
I do this:
<?
$result=mysql_query(SELECT * FROM tablename);
//In this example I supose that I know that there is only one row in the
result.
$field1=mysql_result($result,0,field1);
if($field1==NULL):
my_function();
else:
another_function();
endif;
?>
Why doesn't works?? I've been doing it with PHP/FI, but why can't do it
in PHP3?
Thanks a lot!
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net