Using List() and a do-while loop with MySQL results.

From: Date: Sat, 22 Jan 2005 00:02:13 +0000
Subject: Using List() and a do-while loop with MySQL results.
Groups: php.general 
Request: Send a blank email to php-general+get-207012@lists.php.net to get a copy of this message
Greetings all, I am pulling records from a MySQL DB. I am walking through the array using the whole. if ( $row = mysql_fetch_assoc($result)) { do { // Some stuff } while ( $row = mysql_fetch_assoc($result)); } What I am wondering is if there is something I can do like. if ( list ($id, $someinfo) = mysql_fetch_assoc($result)) { do { // Some stuff } while ( list ($id, $someinfo) = mysql_fetch_assoc($result)); } When I tried something like that The variables where not populated. Is there something I am doing wrong, or is this just something that cannot be done (or is bad programming practice??) Thanks. -- Blessed Be Phillip

« previous php.general (#207012) next »