The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Can I get a push in the right direction please?

Ok. I'm trying to make some halfway functional forums. Now, I have the catagories in the database, and pulling from it in my forum.php. What I want, is for the user to click the category name, and it drops down and lists the forums in that category. I assumed it would use this

Code:

<a href="forums2.php?cat_id=<? echo $cat_id ?>

so I already put it in, as you can see. Yes, on the database the forums have what category id they are assigned to.

If you need a visual of what I'm talking about, here's a pic (of what's output'd from the code below):

Ok look at the picture. Those are categories. Now, within those catagories I have forums.. or subcategories. Right now the categories you see are "closed". What I want is to be able to click the plus sign to the left, and it drops down that category and lists the sub categories that are within it.

I realize this is a tough one to grasp because it seems so vage and there are so many variables unanswered for you guys.

Categories are being pulled from one table right now using cat_id. The sub categories under them are in a different table, "forums", with their own forum_id, but also each is assigned a number to which cat_id it is to go under.

Ok look at the picture. Those are categories. Now, within those catagories I have forums.. or subcategories. Right now the categories you see are "closed". What I want is to be able to click the plus sign to the left, and it drops down that category and lists the sub categories that are within it.

I realize this is a tough one to grasp because it seems so vage and there are so many variables unanswered for you guys.

Categories are being pulled from one table right now using cat_id. The sub categories under them are in a different table, "forums", with their own forum_id, but also each is assigned a number to which cat_id it is to go under.

Kinda hard to explain...

keep in mind page has to reload completely at every click... Now I don't like to say this but I guess javascript is better for such things.
I have programmed a tree fold-out, like you want, and it's quit a lot of code for such a small "feature".
code below does this and in extra makes a button with GD-libraries, but you can strip that part if you like.

row 0 is the first field into your category database table!
so it means that that is id...
and cat_id is the varable which contain that id couse we call it twice since this variable is stored into subcategories field to link with category field!