note 14250 deleted from function.list by wez

From: Date: Thu, 15 May 2003 20:10:47 +0000
Subject: note 14250 deleted from function.list by wez
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-48036@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

« previous php.notes (#48036) next »