array confusion...
| From: | Dan Joseph | Date: | Mon, 24 Nov 2003 20:42:40 +0000 |
| Subject: | array confusion... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-170823@lists.php.net to get a copy of this message | ||
Hi,
I must be missing something in this array. To me this makes no sense.
Here is it broken down...
Declartion:
$gtotals = array(
"CO1" => 0,
"CO2" => 0,
"CO3" => 0,
"CO4" => 0,
"CO5" => 0,
"CO6" => 0,
"CO7" => 0
);
Code run:
while ( list( $action_code, $date_created, $date_letter_send ) =
mysql_fetch_row( $raw_res ) )
{
if ( $action_code == 'C01' || $action_code == 'C02' ||
$action_code == 'C03' || $action_code == 'C04' ||
$action_code == 'C05' || $action_code == 'C06' ||
$action_code == 'C07' )
{
$totals[$date_created][$action_code]['created_count']++;
$gtotals[$action_code]++;
$dgtotals[$date_created]++;
$ggtt++;
$count++;
}
}
print_r results:
Array
(
[CO1] => 0
[CO2] => 0
[CO3] => 0
[CO4] => 0
[CO5] => 0
[CO6] => 0
[CO7] => 0
[C01] => 15
[C02] => 40
[C03] => 50
[C04] => 4
[C05] => 4
)
Now, the problem I'm having is that when I echo $array['C06'] and
$array['C07'] I'm getting "" (nothing..). Could someone point out how this
can be, and what I've done wrong?
-Dan Joseph