php3-list | 199901

[PHP3] Array declartation From:  <email protected>
Date: 01/26/99

Is is possible to assign values to an array using varibles?
$temp = 19901
$totals[$temp] = 0;
then do something like :
mysql_result($fdata= <email protected>($result,$i,$fieldname);
                                        
if ($fdata==$currentcode) {
        $fieldname=mysql_field_name($result, 1);
$fdate=mysql_result($result,$i,$fieldname);
        $fieldname=mysql_field_name($result, 4);
        $fdata=mysql_result($result,$i,$fieldname);
        $totals[$fdate] = $fdata + $totals[$fdate];
        }

What I hope this does is takes a range of dates, creates an array of those dates
and then assigns values to those array places that the date in $fdate matches.
Does this make sense?
Should this work?

I haven\'t put the full code in as it is pretty chunky, but $temp is assigned
the
date variable which should change each time through a loop.

--
PHP 3 Mailing List   http://www.php.net/
To unsubscribe send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest list:  php3-digest-subscribe <email protected>
For help: php3-help <email protected>  Archive:  http://www.php.net/mailsearch.php3
List administrator:  zeev-list-admin <email protected>