MySQL
  Home arrow MySQL arrow Page 2 - Building a Simple ColdFusion Content Management System with MySQL
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
MYSQL

Building a Simple ColdFusion Content Management System with MySQL
By: Charles Kaufmann
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 46
    2004-08-11


    Table of Contents:
  • Building a Simple ColdFusion Content Management System with MySQL
  • Starting With MySQL
  • The Page and how to Update/Modify and Delete
  • Add/Modify Form
  • Action
  • Breadcrumb List
  • Side Menu
  • Site Map

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Building a Simple ColdFusion Content Management System with MySQL - Starting With MySQL
    ( Page 2 of 8 )

    First of all we have to build the table that will hold all our pages. Throughout this tutorial I will use page and database record interchangeably because the pages of this content management system are stored as database records.

    CREATE TABLE `tblpages` (
      `id` int(11) NOT NULL auto_increment,
      `parentid` int(11) default NULL,
      `title` varchar(200) default NULL,
      `body` text,
      `createddate` datetime default NULL,
      `updatedate` datetime default NULL,
      `status` char(1) default NULL,
      `hierarchy` varchar(255) default NULL,
      PRIMARY KEY (`id`),
      UNIQUE KEY `id` (`id`)
      ) TYPE=MyISAM

    I will walk you through what the fields are for and what they will help us to accomplish.

    The ID is going to be the unique key for each page. You will be able to call a specific page with the id number.

    ParentID is going to allow us to do the site map and breadcrumb trail and also the side menu. This field stores the ID number of the page that is it's parent. It is hierarchical data in that it represents a parent child relationship. Lets say a page with an id of 3 has a page off of it with an ID of 4. Page 3 would be the parent and page 4 would be the child.

    The Title field will be used in several places. First it can be used on the top of every page as (you can probably guess this one) a title. It will also be used in the menu and the breadcrumb list, so when you are entering titles, you don't want them to be too long.

    The Body is for whatever you want to put on the page.

    The CreatedDate will store the date and time the page was originally created.

    The UpdateDate will get updated every time you modify the page. We will use this field in the site map so that people will readily be able to see how up to date your web site is.

    Status is used to delete pages. The value will either be A for active and D for deleted. All the queries to display a page will check to see if the page is active.

    The Hierarchy field is build to minimize the server overhead and make the whole page easier to present. All the pages will be organized hierarchically starting with the home page. Instead of running some complex queries every time the page loads, we are going to create a list of the hierarchy when the page is created. We will use the page ID. Once created the Hierarchy will look something like this "1~3~5~12". What that means is that the page with ID equal to 1 (the home page) has a child page off of it with an ID of 3, which has a child page off of it with an ID of 5, which has a child page off of it with an ID of 12.



     
     
    >>> More MySQL Articles          >>> More By Charles Kaufmann
     

       

    MYSQL ARTICLES

    - MySQL Security Tips
    - Designing a MySQL Database: Tips and Techniq...
    - The Three Most Important MySQL Queries
    - Null and Empty Strings
    - MySQL Server Tuning Tips and Tricks
    - MySQL Query Optimizations and Schema Design
    - MySQL Benchmarking Tools and Utilities
    - MySQL Benchmarking Concepts and Strategies
    - Take Some Load off MySQL with MemCached
    - MySQL Table Prefix Changer Tool in PHP
    - Using the SIGNAL Statement for Error Handling
    - Error Handling Examples
    - Error Handling
    - Completing a Search Engine with MySQL and PH...
    - Paginating Result Sets for a Search Engine B...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek