note 10698 added to mysql_fetch_array
| From: | iblden at yahoo dot com | Date: | Thu, 18 Jan 2001 03:17:05 +0000 |
| Subject: | note 10698 added to mysql_fetch_array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-9915@lists.php.net to get a copy of this message | ||
I also found that if the first record in my query contained NULL values in the cooresponding cells,
"nothing" is saved to the variables being used in the loop. That is, the NULL value is
stored in the variable used to present the column's value. If the first record contains NULL
then (as mentioned in a previous post) as the loop continues, the variables associated with the next
row will also be set to NULL. So, if your Select statement returns 79 records and the first record
contains all NULL values, You will be presented with a "blank" table when you actually
expect 79 records posted.
hmmm. i think i represented that correcty.
So how do i test for NULL values in this While loop --->
while ($row = mysql_fetch_array($sql_result)) {
$first_name = $row["FirstName"];
$last_name = $row["LastName"];
$home_phone = $row["HomePhone"];
$email = $row["EmailName"];
----------------
iblden.
http://www.php.net/manual/en/function.mysql-fetch-array.php