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

Dale Bengston dbengston at preservationstudio.com
Tue Aug 22 22:50:52 MDT 2006


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20060822/8b7d5f2c/attachment.html


More information about the FX.php_List mailing list