Strange anomolie with each() and mysql_fetch_array()

From: Date: Fri, 24 Jan 2003 05:38:30 +0000
Subject: Strange anomolie with each() and mysql_fetch_array()
Groups: php.general 
Request: Send a blank email to php-general+get-132946@lists.php.net to get a copy of this message
How come I *can* do these commands: $row = mysql_fetch_array($result,MYSQL_ASSOC); while(list($myVariableName,$sqlFieldName)=each($row)) { $$myVariableName = $sqlFieldName; } But I can't do this command? while(list($myVariableName,$sqlFieldName)=each(mysql_fetch_array($result ,MYSQL_ASSOC))) { $$myVariableName = $sqlFieldName; } Notice the only differenceis that the first one assigns the array to $row FIRST, whereas the second tries to avoid that extra call, especially since I know I'm only getting one row back. Hmmm?

« previous php.general (#132946) next »