On Thu, 2006-12-21 at 14:54 +0200, Yonatan Ben-Nes wrote:
> Hi all,
>
> I got a problem with creating a multidimensional array which it's size is
> unknown.
> I already made it work like this (example):
> $array = array('six','five','four','three','two','one');
>
> for ($i = count($array)-1; $i
you can do this with a bit of reference magic...
there might a cleaner/better way - if anyone can correct me I'd
be glad to learn :-)
Yonatan Ben-Nes wrote:
> Hi all,
>
> I got a problem with creating a multidimensional array which it's size is
> unknown.
> I already made it work like this (ex
Hi all,
I got a problem with creating a multidimensional array which it's size is
unknown.
I already made it work like this (example):
= 0; $i--) {
$array_keys_string_representation .= '["'.$array[$i].'"]';
}
eval('$new_array'.$array_keys_string_representation.'["node_title"] =
"string value";'
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 ($
$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
>}
>
>echo $quarterbacks["GARCIA"]["YARDS"];
>
>Jason Lotito
>[EMAIL PROTECTED]
>www.NewbieNetwork.net
>
>> -Original Message-
>> From: J. Roberts [mailto:[EMAIL PROTECTED]]
>> Sent: Thursday, December 06, 2001 4:08 PM
>> To: [EMAI
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] Cre
AIL PROTECTED]
www.NewbieNetwork.net
> -Original Message-
> From: J. Roberts [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 06, 2001 4:08 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Creating multidimensional array dynamically
>
>
> I can't seem to figure
I can't seem to figure out how to create a multidimensional array from
a database query. Here is an example of what I was looking for, using
NFL quarterbacks as a statistical foundation...
A record contains the following fields:
NAME, ATTEMPTS, COMPLETIONS, YARDS, TD, INT
Now I would like to be
9 matches
Mail list logo