note 14250 added to function.list.php

From: Date: Tue, 24 Jul 2001 02:34:11 +0000
Subject: note 14250 added to function.list.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-15750@lists.php.net to get a copy of this message
Courious, when you assign more than 1 field from a mysql result into the same variable, 'list' seems to reverse the elements' order: Exemple: // Let's say I have "1" in "field1", "2" in "field2", etc... $result = mysql_query("select field1, field2, field3, field4 from $table where(blah='1')"); list($field[], $field[], $field[], $field[]) = mysql_fetch_row($result); //Now, I expect to have an array like this: Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 ) //Insted we get the same array, but in reverse order. Maybe it's a bug, I don't know. //Anyway, you always can add: $field = array_reverse($field); //to get things on right places. I hope it helps, sincerely, João Paulo M. Fischer FAMED-UFRGS http://www.php.net/manual/en/function.list.php

« previous php.notes (#15750) next »