PHP listing entries under a certain category

Soldato
Joined
2 May 2004
Posts
19,950
Hi,

Not a particularly good title, but I was wondering if anyone could help me out doing this please...

Basically I have a categories database which is printed out in drop-down menu on a form. The user selects the category they want the entry to go into. Each category has an ID, so when they click submit the ID of the category gets submitted to the field called 'category' in the entries database. :eek:

Now, when I print out what has been added to the database I want to have a layout similar to this:

Code:
[b]Category name 1[/b]
  Entry one
  Entry two
  Entry three
  Entry four

[b]Category name 2[/b]
  Entry one
  Entry Two

And so on...

I really can't think of a good way to do this so it's nice and dynamic.

Any ideas please?

Of course I could do it the bad way and make a query for each of the categories, but that's not really an option as new categories will be added all the time meaning I'd have to edit the php file a lot :rolleyes:

Thanks,
Craig.
 
Back
Top Bottom