Re: [PHP] Creating multidimensional array dynamically

2001-12-06 Thread Mike Eheler
Oops.. my bad $quarterbacks[$data['NAME']][$key] = $value; Mike Mike Eheler wrote: > $result = mysql_query("select NAME,ATTEMPTS,COMPLETIONS,YARDS,TD,INT > from players where pos = 'QB'"); > // or whatever it takes to get just qb's > while ($data = mysql_fetch_array($result)) { >foreach ($

Re: [PHP] Creating multidimensional array dynamically

2001-12-06 Thread Mike Eheler
$result = mysql_query("select NAME,ATTEMPTS,COMPLETIONS,YARDS,TD,INT from players where pos = 'QB'"); // or whatever it takes to get just qb's while ($data = mysql_fetch_array($result)) { foreach ($data as $key => $value) { // I've noticed that $data stores numeric and text keys, this

RE: [PHP] Creating multidimensional array dynamically

2001-12-06 Thread jimtronic
you could also do this ... $data = mysql_fetch_assoc($res); //this is a nice function because it returns an associative array. so // if you change your SQL db, you wouldn't need to change your php code // as much. $quarterbacks[$

Re: [PHP] Creating multidimensional array dynamically

2001-12-06 Thread Dennis Moore
Not sure what you are trying to do, but try using mysql_fetch_row () you can use SQL to limit your results. /dkm - Original Message - From: "J. Roberts" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, December 06, 2001 4:08 PM Subject: [PHP] Creating multidimensional array

RE: [PHP] Creating multidimensional array dynamically

2001-12-06 Thread Jason Lotito
Something like this? while( list( $name, $attempts, $completions, $yards, $td, $int ) = mysql_fetch_row($res) ) { $quarterbacks[$name] = array( "ATTEMPTS" => $attempts, "COMPLETIONS" => $completions,