Add forum feature php application

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vssp
    Contributor
    • Jul 2006
    • 268

    Add forum feature php application

    hai friends


    I need to add the forum featue to my application.I need some ideas ,suggestion how to develope the forum featute or any sample code avialbele .Please help me
    _______________ ___
    Thanks
    Vssp
  • tbb9216
    New Member
    • Sep 2006
    • 16

    #2
    i would approach this pretty much as you would a shopping cart.

    instead of storing mass amounts of info in the db, store references to threads in the db.

    example:

    CREATE TABLE `thread`
    (`threadId` int(11) NOT NULL PRIMARY KEY auto_increment,
    `threadTitle` varchar(255) not null,
    `threadDate` date());

    CREATE TABLE `thread_message s`
    (`messageId` int(11) NOT NULL PRIMARY KEY auto_increment,
    `messageThread` int(11) not null,
    `messageDate` date(),
    `messageData` TEXT,
    `messageUser` varchar(255) not null);

    to read thread #17:

    SELECT t.threadTitle, t.threadDate,
    m.messageId, m.messageThread ,
    m.messageDate, m.messageData,
    m.messageUser
    FROM thread t, thread_messages m
    WHERE t.threadId = '17'
    AND t.threadId = m.messageThread
    ORDER BY m.messageDate
    ASC

    this will grab all posts that correspond to thread #17 and put them in a query for you to do whatever with. obviously variables can be users instead of constants, such as the threadId = 17 and what not. let me know if you need more info about any specific detail.

    good luck, let me know how it works out,

    -tim

    Comment

    Working...