note 85204 added to function.is-null
| From: | mdufour at gmail dot com | Date: | Wed, 20 Aug 2008 04:31:21 +0000 |
| Subject: | note 85204 added to function.is-null | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-143667@lists.php.net to get a copy of this message | ||
Testing for a NULL field/column returned by a mySQL query.
Say you want to check if field/column âfooâ from a given row of the table âbarâ
when returned by a mySQL query is null.
You just use the âis_null()â function:
[connectâ¦]
$qResult=mysql_query("Select foo from bar;");
while ($qValues=mysql_fetch_assoc($qResult))
if (is_null($qValues["foo"]))
echo "No foo data!";
else
echo "Foo data=".$qValues["foo"];
[â¦]
----
Server IP: 216.235.15.211
Probable Submitter: 205.205.253.95
----
Manual Page -- http://www.php.net/manual/en/function.is-null.php
Edit -- https://master.php.net/note/edit/85204
Del: integrated -- https://master.php.net/note/delete/85204/integrated
Del: useless -- https://master.php.net/note/delete/85204/useless
Del: bad code -- https://master.php.net/note/delete/85204/bad+code
Del: spam -- https://master.php.net/note/delete/85204/spam
Del: non-english -- https://master.php.net/note/delete/85204/non-english
Del: in docs -- https://master.php.net/note/delete/85204/in+docs
Del: other reasons-- https://master.php.net/note/delete/85204
Reject -- https://master.php.net/note/reject/85204
Search -- https://master.php.net/manage/user-notes.php