MyBB Community Forums

Full Version: Inserting Threads Directly into the Database
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Any guides on this?

If I just inserted them into the 'posts' table, could i run a script that would generate the stuff in the 'threads' table based on the topic of the first post and the postid of the last post? Then I could I run another script to create the 'forums' table insert.

Am I missing any tables?

Any recent guides on this?

Also is there a way to use the poster name instead of the poster id, then reference the ids from the name, given that both are unique?

I can get around this by carefully modifying the insert statements, but it would be nice if I didn't have to.
Posts in post table contains tid which indicates of which thread the post belongs to.
Decide the target thread id (tid) from threads table, fetch all posts with that tid from posts table and order by 'dateline'. Highest is the last post, lowest is the first post.
My point is that you should be able to generate the threads via script, if you have the post.

The thread's title can come from the first post and it can know the first post by the timestamp order.

That way it would be much easier. Still possible the other way.