note 23835 deleted from function.extract by dams

From: Date: Tue, 30 Jul 2002 00:45:40 +0000
Subject: note 23835 deleted from function.extract by dams
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-33938@lists.php.net to get a copy of this message
$query = "select one,two,three from table"; $res = mysql($dbname,$query); echo mysql_error(); for ($i=0;$i<mysql_num_rows($result);$i++) { extract(mysql_fetch_array($result),EXTR_OVERWRITE); echo "$one, two, three"; } //this will work for those, like myself, who have large databases and dont want to write mysql_result($result,$i,one) over and over again. And it does it row by row automatically. //Note that once you do an extract on an mysql array, and maybe regular arraries, it will destroy the array. //Also note that if you have multiple mysql arraries, you must call the extract for any particular mysql array BEFORE you send another mysql query. The typical extract error will pop up if you don't do this.

« previous php.notes (#33938) next »