Reply to Re: Formatting output from database

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация