Topic: How to create forum like RAILS forum

Hi, I try to create forum like this forum.
I created table topics for new topic and table replies for all comments.
I got ....
topic#1 => comments#1, comments#2, comment#5
topic#2 => comments#3
topic#3 => comments#4
.........instead of........
topic#1 => comments#1, comments#2
topic#2 => comments#1
topic#3 => comments#1

table topics has id(PK) and table replies has id(PK, auto_increment) and topic_id.
How do I set auto_increment comment start at 1 when I have new topic?
Thank you.

Last edited by jeda (2006-11-23 00:08:57)

Re: How to create forum like RAILS forum

not sure I understand the question.

so you got a table for topics and a table for comments. and you want the id's to run incrementally for each comment.
ie topic 1 has comments 1 - 5
and topic 2 has comments 1 - 7

If thats what you are after you are proberly going to have a headache with id's
even if
topic 1 has comments id, 1,3,5
and topic 2 has comments id, 2,4,6,7

I dont see the problem, as you can still order them by there id's and you can isolate the ones you want from the topic_id
maybe I dont get the question.

--