[FX.php List] How do I display subsummarized data on my webpage?

Dale Bengston dbengston at preservationstudio.com
Wed Mar 29 19:29:03 MST 2006


Hi Laura,

Start by sorting your records by category. Then check to see if the  
category has changed for each new record you tick through. If it has  
changed, you've encountered a new category, so write out the new  
category and update the variable. Sorta like this...

$cat = 'foo';

foreach ($fxResult as $key => $value)
	{
	if ($cat != $value['category'][0])
		{
		//[write out the new category]
		$cat = $value['category'][0];
		}
	//[write out your book info for each record]
	}

This is untested pseudo-code, but it should get you started.

Hope this helps,
Dale Bengston

On Mar 29, 2006, at 8:05 PM, Laura Long wrote:

> Hi,  I have a query that returns a list of book titles.  Stored within
> the database is a category that has been assigned to each title,  
> how can
> I make it display the Category name, then the books assigned to that
> category, the next Category then, the books assigned to that one, etc.
> The query is on a specific set of books, such as all books beginning
> with "A".
>
> Thanks for any help offered :)
>
> Laura
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list