What is the structure of the Database behind phpBB? When it is running on MySQL that is. Just a rough outline of what sort of fields are necessary, how the threads are stored, what datatypes they might be etc.
I am thinking of writing a messageboard that is small and very simple, without any frills that phpBB might have - I just need to know roughly where to start in terms of database design.
Structure of phpBB?
Moderator: General Moderators
I've never installed it so I couldn't tell you but it is a free program. Just go to http://phpbb.com/downloads.php and download it to check out some of the files.
The easiest way to do it is to write down everything to might need to store in the database and then devide your list into groups of 'related' info.
--------------
For example when I create simple forums I will use some tables like this..
forum_registration ( id, username, password, emailaddress, status )
forum_profile ( username, fullname, age, dob, location, gender..... etc )
forum_membersetup ( username, topicsperpage, repliesperpage, gmtoffset... etc )
forum_topics ( id, title, blurb, date, postedby, status, views )
forum_replies ( id, parent, blurb, date, postedby, status )
--------------
Hope this helps?
--------------
For example when I create simple forums I will use some tables like this..
forum_registration ( id, username, password, emailaddress, status )
forum_profile ( username, fullname, age, dob, location, gender..... etc )
forum_membersetup ( username, topicsperpage, repliesperpage, gmtoffset... etc )
forum_topics ( id, title, blurb, date, postedby, status, views )
forum_replies ( id, parent, blurb, date, postedby, status )
--------------
Hope this helps?
Yep, keep all of your topics in one table, and all of your replies in another.
I normally have the 'reply parent' as the 'topic id' which the reply is for.
I also add a timestamp to the end of the topics and replies so that I can display them in the right (or chosen) order.
You can also use the topic and/or reply timestamps, along with cookies to check if any new topics/replies have been added while the user was away... like phpBB.
I normally have the 'reply parent' as the 'topic id' which the reply is for.
I also add a timestamp to the end of the topics and replies so that I can display them in the right (or chosen) order.
You can also use the topic and/or reply timestamps, along with cookies to check if any new topics/replies have been added while the user was away... like phpBB.
So something like (at minimum):
Boards (ID, Name, List of thread IDs)
Threads (ID, Title, List of Post IDs)
Posts (User, Timestamp, IP, Message Data)
Would be a way of going about it? How would I implement the lists in a database? Is there a MySQL datatype for arrays of sorts, and is it extendable (ie doesn't need to be DIMed)?
Boards (ID, Name, List of thread IDs)
Threads (ID, Title, List of Post IDs)
Posts (User, Timestamp, IP, Message Data)
Would be a way of going about it? How would I implement the lists in a database? Is there a MySQL datatype for arrays of sorts, and is it extendable (ie doesn't need to be DIMed)?
I can't write your entire database layout for you mate... it's not difficult really... just think about what data is going to need to be pulled from, and entered, into the database.
Sorting out your datatbase is the easy bit, coding your forum is harder, so if you are having trouble working out which tables to use and what fields should be in the tables then this isn't going to be an easy job for you.
I take it you know how to read/write data to a MySQL database using PHP?
Sorting out your datatbase is the easy bit, coding your forum is harder, so if you are having trouble working out which tables to use and what fields should be in the tables then this isn't going to be an easy job for you.
I take it you know how to read/write data to a MySQL database using PHP?