note 1523 deleted from function.mysql-fetch-array by betz
| From: | betz@php.net | Date: | Wed, 05 Oct 2005 11:29:37 +0000 |
| Subject: | note 1523 deleted from function.mysql-fetch-array by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-96420@lists.php.net to get a copy of this message | ||
Note Submitter: sasha at mathforum dot com
----
Note that mysql_fetch_* will not set any columns whose value is NULL. so, if you have a row with 10
columns, and 5 of them are NULL, then mysql_fetch_row/array will return 5-element
array (mysql_fetch_array being a special case)!
This is very misleading if you expect the number
of elements in the array returned by mysql_fetch_row to always match the number of columns in your
table.
(Ed. Note: many people will vehemently argue that using NULLs in the first place is a bad idea.)