Re: mysql_fetch_array

From: Date: Sun, 23 Jul 2000 03:26:34 +0000
Subject: Re: mysql_fetch_array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-7749@lists.php.net to get a copy of this message
See the docs for mysql_fetch_array, specifically MYSQL_NUM & MYSQL_ASSOC... Sterling > hey all, > > So in a regular associative array you can walk through > the values with a list() = each > > but after running a query and using mysql_fetch_array, > say... > > $result = mysql_query("select 1 as fred, 2 as barney"); > $row = mysql_fetch_array($result)) > > the array will have 4 elements. When you walk through them > with list()=each(), you'd get this: > > key : 0, value = 1 > key : fred, value = 1 > key : 1, value = 2 > key : barney, value = 2 > > > It's easy enough to work around this, but I'm curious as to why > this assoicative array is a bit different than a normal associative array, > where you can get at the values by key or ordinal reference. Is there > a good reason for things working this way that I can't think of? > > -j > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#7749) next »