NYCPHP Meetup

NYPHP.org

[nycphp-talk] learning about foreach continued

Malcolm, Gary gmalcolm at professionalcredit.com
Wed May 21 16:16:02 EDT 2003


your foreach is incrementing through the first array (or row) of the
result...

try

//get all result
$query= mysql_query("select * FROM taxa_order");

//get each row
while( $result = mysql_fetch_assoc($query){
	//get rid of array
 	extract($result);
	// build options
	$options = "<options>$order_name</options>";
}

print(<select>$options</select>); 

foreach is more apropos when doing thing like listing elements of an array

hope this helps 

gary. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20030521/fd3a1baf/attachment.html>


More information about the talk mailing list