Re: [PHP3] building multidimension arrays UPDATE
| From: | (Richard Lynch) | Date: | Fri, 09 Jun 2000 20:51:03 +0000 |
| Subject: | Re: [PHP3] building multidimension arrays UPDATE | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-1441@lists.php.net to get a copy of this message | ||
In article <3BBB77BA22DBD31184C80050DA7AA660128C7A@144.bzln.com>,
kiethv@bzln.com (Keith Vance) wrote:
> Here is my latest snippet of code:
> $counter = 0;
> while ($l = mysql_fetch_row ($result)) {
$listElements[$counter]["id"] = $l[0];
$listElements[$counter]["name"] = $l[1];
$listElements[$counter]["desc"] = $l[2];
> $counter++;
> }
>
> This works for putting one of the lists in an array put it doesn't add the
> other lists to the array. I am thinking of using the $count variable to help
> with the problem, but I am still working on what will make it go.
You may want to switch the [$counter]["id"] order to be ["id"][$counter]
(and the other two).
It doesn't matter what order you pick in this usage, so long as you are
consistent.
--
Richard Lynch | If this was worth $$$ to you, buy a CD
US Customer Support Director | from one of the artists listed here:
Zend Technologies USA | http://www.L-I-E.com/artists.htm
http://www.zend.com | (this has nothing to do with Zend,
duh!)