Ok I understand what your doing now. But why can't you make a field in your data base that would hold a unique_id variable and create the unique_id variable and hide it in the form. Let's go through the scenario again. Your way if I understood was:
User x writes a thread, thread_id = 1.
User y answers the thread, thread_id = 1, child_id = 1.
User z answers same thread, thread_id = 1, child_id = 2.
My way is:
User x requests to write a thread. create unique_id = 1abc(not an actual uniqid as would be created by the uniqid() function) and hide it in the form. After he writes the thread and sends it back to the server, you save unique_id in the database with thread_id.
User y wants to answer. Before the form was generated again a unique_id was made. unique_id = 2def. User y sends data back and unique_id and thread_id = 1 and child_id = 1.
User z also wants to answer the same thread and when his/her form was created it too had a unique_id variable. Then when user z sends the data back it too is stored in the db.
So now the fun part. When the data is sent back, the data base must be checked for the unique_id. If it is there then the data is doubled.
It's that easy. Check out http://www.phpbuilder.com/manual/function.uniqid.php Here the function uniqid() is explained.
Lots o luck.
Scott