I am trying to put together my own forum.

I have a MySQL table called "posts". it has a field called "post_thread_id". Now, if I didn't want to create a separate threads table, how could I set it so that when a new thread is created, "post_thread_id" is set to auto_increment, but when it is a reply to an existing thread, it would use $_GET to grab the current thread_id? I don't think PHP can modify MySQL table attributes on the fly, and I don't know how to use PHP to generate a consistent stream of auto_increment numbers.

Something like:

PHP Code:
if (isset($_GET['thread_id']))
{
    
$thread_id $_GET['thread_id'];
}
else
{
    
$thread_id auto_increment;

I am coding this all assuming that the url of a post would be similar to vb and phpBBs.

I'm doing this for the learning experience. I mean, I wanted to see how hard it would be to code a forum.