Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I'm trying to make a small content management system. not a full blown one.
I just need it for users to login type in their articles place them in the appropriate categories or create new ones. and then the site to display them.I need a database schema for this.
I just dont know how to deal with these multi-level categories thingy like
Category 1
sub_cat_1_1 content 1
suc_cat_1_2 content 2 content 3
Category 2
sub_cat_2_1
sub_cat_2_ contentsThanks
Money not an issue?
Where do you live and when are you not home?
I'm not gonna rob you, I'm just gonna steal some stuff

you should look at other CMS' db schema, look at phpBB's, it's not too complicated as it's not a full-blown CMS but hopefully you can learn how to make an efficient scheme.
I'll say, create these tables for example:
articles
id - author_id - timestamp - category_idcategories
id - nameauthors
id - namearticle_text
id - text
That way, the table that being used for general process is the `articles` table which will be efficient as it only has numbers in it. And you can use LIMIT when fetching infos from other tables.The INT types or other column types, or the index types, is up to you. Can't say which one is better, take a look at phpBB's first :D
Or you can of course ask in here if the question is more specific.

about subcategories:
add a `subcat_id` column in `articles`
and create a `subcat` table with these as column:
id - category_id - name
in phpBB, there're these tables:forums
topics
posts
posts_textthese are the columns in `posts` (or `articles` in your case):
post_id
topic_id
forum_id
poster_id
post_time
poster_ip
post_usernameand a few more but not too related.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |