SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Threaded View

  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2004
    0 Post(s)
    0 Thread(s)

    Repost.. [EDIT: I've Done It!!]

    I posted this the other day, and while someone was kind enough to hang with me for about 12 hours and try to get it to work, it didn't. So I want to try again but hear me out.. the methods that were being sent to me weren't quite the method I figured to be easiest. Although I am the new guy. Please bear with me, getting the forums function is my main goal, as it is the basis of the site. Anyway, here goes: (I apologize in advance for whatever headaches I may cause)

    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 goes to forums2.php and drops down and lists the forums in whatever category they clicked. I assumed it would use this:

    <a href="forums2.php?cat_id=<? echo $cat_id ?>
    If you need a visual of what I'm talking about, click here.

    forums.php works fine. I imagine forum2 would just be an altered version of this one, so that when it pulls the category thats sent through the url (with cat_id), it will also list the forums that are associated with it and list them.

    table "categories":


    table "forums"-- sub category

    .................^This is how the forums associate with parent cat.

    Here is my code for forums.php:
    <TABLE WIDTH="100%" border="1" CELLSPACING="0" CELLPADDING="3" bgcolor="#D4D8D6"> 
    <TR ALIGN="left"> 
    <TD WIDTH="2%" CLASS="boardheading" Background="images/top.gif">+ 
    <TD WIDTH="73%" CLASS="boardheading" ALIGN="center" Background="images/top.gif">Category Titles 
    <TD WIDTH="5%" CLASS="boardheading" ALIGN="center" Background="images/top.gif">Topics 
    <TD WIDTH="5%" CLASS="boardheading" ALIGN="center" Background="images/top.gif">Posts 
    <TD WIDTH="15%" CLASS="boardheading" ALIGN="center" Background="images/top.gif">Last post 
    require 'db_connect.php'; 
    $query="SELECT * FROM categories ORDER BY cat_order ASC"; 
    if ($num==0) { 
    echo "No Entries."; 
    } else { 
    if ($num>25) { 
    while ($i < $to) { 
    <TR ALIGN="left"> 
    <TD><a href="forums2.php?cat_id=<? echo $cat_id ?>" style="color:#333333;">+</a><TD><a href="forums2.php?cat_id=<? echo $cat_id ?>" style="color:#333333;"><? echo $cat_title ?></a><TD>10<TD>100<TD>Phases 
    echo "<TR ALIGN='left'> 
    Any ideas?
    Last edited by Phases; Nov 23, 2004 at 04:33.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts