Home arrow PHP arrow Building a Relational Content Management System in PHP/MySQL

Building a Relational Content Management System in PHP/MySQL

You may be familiar with relational databases, but what is a relational content management system? Read on to learn how to build this system, which helps you create a search engine friendly site fairly quickly.

TABLE OF CONTENTS:
  1. Building a Relational Content Management System in PHP/MySQL
  2. The Rewrite
  3. The Common Functions
  4. Managing Articles
  5. Displaying the Articles
By: Roger Stringer
Rating: starstarstarstarstar / 39
December 20, 2005

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Introduction

This article will show you how to build a simple relational content management system. What is a relational CMS you ask? Well, a relational CMS lets you create articles that have child articles.

This works similiar to other CMSes which have categories and then articles; we will just combine them together to be more relational.

This also helps to create a nice search engine friendly site quickly.

To keep this article easy to follow, I'll keep the relational CMS simple, but you can change it quite easily to add more stuff to it.

The Database

Our first step is to build the database. This is a pretty basic database designed for the articles. We'll need one table for this.

CREATE TABLE articles (
    id BIGINT( 24 ) NOT NULL AUTO_INCREMENT ,
    title VARCHAR( 150 ) NOT NULL ,
    summary TEXT NOT NULL ,
    body TEXT NOT NULL ,
    parent BIGINT( 24 ) NOT NULL ,
    seoname VARCHAR( 150 ) NOT NULL ,
    PRIMARY KEY ( id ),
    KEY title(title),
    KEY seoname(seoname),
    KEY parent(parent)
);
INSERT INTO articles SET id='1',title='first page',seoname='firstpage';

You may notice that we also created the first article. We need to have an initial article for the system. You'll also see later that, while you can edit this article all you want, you can't delete it; it is the first page.



 
 
>>> More PHP Articles          >>> More By Roger Stringer
 

blog comments powered by Disqus
   

PHP ARTICLES

- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 8 - Follow our Sitemap

Dev Shed Tutorial Topics: