wayne0126 Posted November 2, 2007 Share Posted November 2, 2007 Hi, Im workin on like a small bbs thing where people can post/reply and add new topics. So far, I pretty much got most of the basic things to work except one thing which is adding new topics. Im not quite sure what to do about that. What I got is two tables in a database which are table_posts and table_topics. Both tables are set to auto increment for their id' fields and I think set them up pretty good. I can do replies to topics easily when someone posts a reply, it goes to the topic easily but adding new topics which adds a new topic and post with it seems to be like updating both tables at the same time. I dont know how to get around that. Like... Person A submits new topic. table_posts has received a new post row with id autoincremented to 3. At the same time table_topics has a new row in it with an id of 2 which receives the id of 3 from the new post on table_posts inserted into its field 'first_post_id'. When this part is done, the row in table_posts with the id of 3 has also its field updated 'topic_id' to 2. This in that now both tables are connected with the correct information. Does that make any sense? Quote Link to comment https://forums.phpfreaks.com/topic/75756-small-custom-bbs-help/ Share on other sites More sharing options...
ignace Posted November 2, 2007 Share Posted November 2, 2007 1. post the table structure, so that we may be of further assistance 2. have you performed a database normalization? if not => http://en.wikipedia.org/wiki/Database_normalization Quote Link to comment https://forums.phpfreaks.com/topic/75756-small-custom-bbs-help/#findComment-383393 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.