[FX.php List] Creating summaries on the fly,

Steve Winter steve at bluecrocodile.co.nz
Tue Aug 22 23:07:46 MDT 2006


Phew...!!

I'm glad you did, 'cause that was what I was trying to say too, and I just
couldn't for the life of me see why it wouldn't work...!! :-)

Cheers
Steve

> Dale,
> 
> I *finally* saw what you were trying to tell me... thanks!
> 
> 
> On Aug 22, 2006, at 11:50 PM, Dale Bengston wrote:
> 
> > You could even make an array that goes something like this:
> >
> > $cars = array();
> >
> > foreach ($recs as $key => $value)
> > 	{
> > 	$cars[$value['make'][0]]['count']++;
> > 	$cars[$value['make'][0]][$value['model'][0]]['count']++;
> > 	}
> >
> > Do a print_r($cars) and see what you have to work with...
> >
> > Dale
> >
> > On Aug 22, 2006, at 11:14 PM, Bob Patin wrote:
> >
> >> Well, so far I've just assigned 2 variables; one's the total for  
> >> each vehicle model, the other is the total for that make
> >>
> >> $var1 = total Ford Tauruses
> >> $var2 = total Fords
> >>
> >> I wrote some code so that it just totals up and writes each type  
> >> of table row when it's time to do so. The client really wants to  
> >> see percentages for each car model, on the same line w/ the car  
> >> model.
> >>
> >> I'm not using an array,  but I'm starting to get a glimmer of what  
> >> you're suggesting:
> >>
> >> I'd create an array to hold the models, their totals, and then the  
> >> total for the make?
> >>
> >>
> >> On Aug 22, 2006, at 11:09 PM, Dale Bengston wrote:
> >>
> >>> Are you writing your sub-summaries to the page as you go through  
> >>> the all the records, or are you making an array first and then  
> >>> writing from the created array?
> >>>
> >>
> >> _______________________________________________
> >> FX.php_List mailing list
> >> FX.php_List at mail.iviking.org
> >> http://www.iviking.org/mailman/listinfo/fx.php_list
> >
> >
> > If this email is spam, report it here:
> > http://www.OnlyMyEmail.com/ReportSpam
> > _______________________________________________
> > FX.php_List mailing list
> > FX.php_List at mail.iviking.org
> > http://www.iviking.org/mailman/listinfo/fx.php_list
> >
> >
> >
> > --
> > If this email is spam, report it here:
> > http://www.OnlyMyEmail.com/reportSpam? 
> > Id=NDIyMTM6MTU3ODc3OTk4OmJvYkBwYXRpbi5jb20%3D
> 
> 




More information about the FX.php_List mailing list