First, if you expect only a single row returned, why are you using a while(){}
construct?
Second, mysql_fetch_array() does not like to operate within another function call.
I've tried it on
multiple occasions; failed.
Third, each() operates on succeeding elements of an array; there are only two elements
aparrently,
so what are you expecting eac() to do?
----- Original Message -----
From: "Daevid Vincent" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 23, 2003 11:38 PM
Subject: [PHP] Strange anomolie with each() and mysql_fetch_array()
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?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php