Posted by J.O. Aho on 03/16/07 16:13
Nosferatum wrote:
> I wonder how to format the output from my db. I retrive the data fine,
> but each post belong to a category (total 4 categories), and I would
> like to have the output sorted under each category in a nice manner,
> like this:
>
> CATEGORY - NAME
> post 1 data...
> post 2 data ...
>
> (space)
>
> CATEGORY -NAME2
> post 1 data...
> post 2 data.. etc.
>
> I just don't know how to do it. Help?
There are different options here, you could make 4 queries, one for each
category. Another way is to have one query and you store each category to an
array (you can also put those together in a multidimentional array) and then
loop throw each array when you want to generate the output.
--
//Aho
[Back to original message]
|