Re: [PHP-DB] Arrays again again

2002-11-13 Thread Peter Beckman
The problem there is that you've got $a[$year] getting set a bunch of times. That is busted code. $a[$year] will only contain the LAST value. Replace that line with this one. $a[] = array(year=>$year, value=>$value); OR $a[$i] = array(year=>$year, value=>$value); Now $a[0][year] = 20

Re: [PHP-DB] Arrays again again

2002-11-13 Thread Marco Tabini
Perhaps I don't understand what it is you're looking for, but... $a = array(); for ($i = 0; $i < $maxvalue; $i++) { $a[$year] = $value; } but this is almost too simple, which probably just means I didn't quite understand your question. Marco -- php|architect - The magazine