Bluehost.com Web Hosting $6.95

array confusion...

This is a discussion on array confusion... within the PHP General forums, part of the PHP Programming Forums category; Hi, I must be missing something in this array. To me this makes no sense. Here is it broken down... ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-24-2003
Dan Joseph
 
Posts: n/a
Default array confusion...

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
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 04:44 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0