I've got the first bit figured out; entering data into the topics table:
Code: Select all
mysql_query("INSERT INTO topics (forum_id, topic_title, topic_desc, topic_poster, topic_time, topic_last_post_id) VALUES ('$forum_id', '$topic_title', '$topic_desc', '$topic_poster', '$topic_time', '$topic_last_post_id')");Now I need to insert data into the posts table where "topic_id" is equal to the value of "topic_id" in the topics table that has just been inserted.
Basically when I insert my data into the topics table a unique number is generated and I need to know this number so I can add to the posts table.
If anyone can help I'd be most thankful.