Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7568719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:59:41+00:00 2026-05-30T14:59:41+00:00

Im working on simple PHP CMS system and Im stuck with database design. This

  • 0

Im working on simple PHP CMS system and Im stuck with database design.

This is the problem.

I have table named pages, it holds all pages I can add and information about this page like page_url, page_order etc..

Now… Every page can be either webpage that can hold some html content. But it can also be a Blog or anything else. There can be only one blog page. And Blog on the other hand can have blog posts and blog categories.

Simply put, I have pages table that represents all pages I can create.
And every page can be different, it can be webpage, blog module, guestbook, contacts page.

And every page will have different purpose.

So the problem is how to design this?

Now this may not be clear at this moment, but here is my current design so maybe it will be easier to grasp what Im trying to achive:

pages
    page_id
    page_name
    page_url
    ...

webpages
    webpage_id
    page_id
    webpage_content
    webpage_date_created
    ...

blogs
    blog_id
    page_id
    ...

blog_posts
    blog_post_id
    blog_post_title
    blog_post_content
    ...

blog_categories
    blog_category_id
    blog_category_name
    blog_category_url
    ...

So, I have pages table that holds all pages, but those pages can be either webpage(simple “static” webpage) or it can be blog, and blog can have posts, categories etc…

So now, if I come to the page which id belongs to webpages template, I joust fetch content and stuff i need and hand it back to controller and the view.

And if I come to the page which id belongs to blog, then I fetch latest posts and show that to the user.

And latter I would like to extend pages so page can be guestbook or anything else.
Basicly, I need database design where pages would be stored in pages table, and each page can be seperate module that would be presented on different way.

Is this the way to go like I described above? Or could it be done better?
Am I doing something wrong here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T14:59:42+00:00Added an answer on May 30, 2026 at 2:59 pm

    There doesn’t seem to be anything fundamentally wrong here – you’re using object-oriented conventions, which I can’t encourage enough. If I understand, all of your pages will be listed in the PAGES table, and then will be connected by PAGE_ID to their appropriate category?

    This allows you to continue to add different page types if you so choose, as well as keep a single list of all of the pages present on your site.

    The only thing I would add, is perhaps a ‘type’ column in your pages table. Even though you’d be able to determine this by running a page_id query on the other (blog and webpage) tables, it might make your life easier in the long-run if you’re interested in really scaling and being able to gather a quick since of your application makeup (25% static pages, etc, etc).

    This layout also would allow you to combine types (if a page_id was present in the blog and webpage tables) you could introduce some static content while also dropping in your dynamic blog features.

    Looks good to me:)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple working PHP script to write an HTML table from a
So I have this simple PHP loop that is generating html table data with
I'm working with my simple PHP captcha algorithm ( http://www.source.ofitall.com/devel/captcha.php ) and I have
I am working within the confines of a php based CMS like system, which
I have a stupid question :) I'm working on a simple php document which
I'm having an issue with a simple PHP mailer. I've had this script working,
i have developed a simple php contact form, that's working fine, but i am
I am working on a quite simple custom made content management system (CMS). There
I'm working on a project (simple XML CMS) just to learn some basic PHP.
I'm looking for good/working/simple to use PHP code for parsing raw email into parts.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.