A simple math and MySQL question

Discussion in 'PHP' started by frako2, Mar 7, 2007.

  1. #1
    I'm working on a forum, and I would like to number each thread with a unique and incrimented number, as well as have a sub number for each reply that goes with the original thread.

    ex: the first post would be 1 if there was a reply it would be 1.1 and so on.

    I tried doing this with a primary key that auto incriments but I can't seem to make it work.

    I'm not very good at functions with php so any help would be greatly appriciated
     
    frako2, Mar 7, 2007 IP
  2. Rich_H

    Rich_H Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Keep the threads and posts seperate.

    In the threads table, you can use your auto increment primary key to identify each thread.

    In your posts table you can associate your posts to the threads primary key. Timestamp each post so you can order them (asc or desc).
     
    Rich_H, Mar 8, 2007 IP