cooldude832 Posted August 9, 2007 Share Posted August 9, 2007 I'm looking into making my own forum script and I want some honest opinions on the backend sql table structure I have. Table 1: Users pk: UserID Table 2: Threads: pk: ThreadID included keys (UserID BoardID) Table 3: Boards: pk: BoardID Table 4: Post: pk: PostID included keys (UserID, ThreadID) Then just apply basic pagination from there to display based on ThreadID/BoardID Is this a good system, or will having all post in 1 table screw me up? Quote Link to comment https://forums.phpfreaks.com/topic/64159-db-structure-to-writing-a-forum-script/ Share on other sites More sharing options...
teng84 Posted August 9, 2007 Share Posted August 9, 2007 you have a crossing table which is table4 so i guess you doing good and u also used id for that as foreign key which is cool Quote Link to comment https://forums.phpfreaks.com/topic/64159-db-structure-to-writing-a-forum-script/#findComment-319755 Share on other sites More sharing options...
Fadion Posted August 9, 2007 Share Posted August 9, 2007 I wrote a small and simple forum just sime time ago and basically my database structure was like yours, having board, thread, posts and users in different tables, with id referencing to the corresponding other. Guess u are ok with the structure. Quote Link to comment https://forums.phpfreaks.com/topic/64159-db-structure-to-writing-a-forum-script/#findComment-319767 Share on other sites More sharing options...
cooldude832 Posted August 10, 2007 Author Share Posted August 10, 2007 Okay next question what type of field do I use for Titles and What type for the Entry. I'm assumgin VarChar for the titles but blob or text for the post? Quote Link to comment https://forums.phpfreaks.com/topic/64159-db-structure-to-writing-a-forum-script/#findComment-320005 Share on other sites More sharing options...
teng84 Posted August 10, 2007 Share Posted August 10, 2007 title use varchar and for the entry or post it depends on how long will you allow your user look and the legnth of those data types and decide what you really need not what you want Quote Link to comment https://forums.phpfreaks.com/topic/64159-db-structure-to-writing-a-forum-script/#findComment-320016 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.