note 54630 deleted from function.mysql-fetch-assoc by philip
| From: | philip@php.net | Date: | Tue, 13 Dec 2005 23:26:46 +0000 |
| Subject: | note 54630 deleted from function.mysql-fetch-assoc by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-100094@lists.php.net to get a copy of this message | ||
Note Submitter: Michael at NoSpam dot example dot com
----
@x403:
The last array element is empty, if you use "<?php while ( $ar[$i++] =
mysql_fetch_assoc($res) );?>".
To avoid this, you can use:
<?php
$i = 0;
while($loopVal = mysql_fetch_assoc($resquery)){
$arrayResult[$i] = $loopVal;
$i++;
}
?>