as in writing your own forum?
I'd go with 2 tables in a database and just link them together using an ID field e.g.
topics table:
|id|blah|blah|blah
Post table
|id|topic_id|post_num|blah|blah|blah
topic_id being the id from the topics table.
i'd use the post_num to arrange them/sort them because if you go by id it'll get confused and arrange them wrong.
sorry I dont have time or effort to write any code.