Assign multiple variables from mysql_fetch_row() call

From: Date: Tue, 04 Sep 2001 21:29:32 +0000
Subject: Assign multiple variables from mysql_fetch_row() call
Groups: php.general 
Request: Send a blank email to php-general+get-65950@lists.php.net to get a copy of this message
In perl I can say something like: ($var1, $var2) = $sqh->fetchrow_array() to assign column values to more than one variable at a time. So I tried similar syntax with PHP: ($var1, $var2) = mysql_fetch_row($sqh); but could not seem to work it out. I know you can do this with a temporary array, and then take values out of the array. But it would be nice to omit the temporary array. Is it possible? Egan

« previous php.general (#65950) next »