PEAR Articles
  Home arrow PEAR Articles arrow Page 2 - Building a Content Management System w...
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Download TestComplete 
Forums Sitemap 
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? 
PEAR ARTICLES

Building a Content Management System with PEAR
By: David Web
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-10-01

    Table of Contents:
  • Building a Content Management System with PEAR
  • The database structure
  • Tables
  • The PEAR::DB connection

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb 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 Content Management System with PEAR - The database structure


    (Page 2 of 4 )

    The application has only three tables, which are of course linked by a foreign key.

    The stories table holds all the information about a particular article as well as a link to its creator. It has the following structure:


    Field

    Description

    sid

    Holds the record number.

    title

    Stores the title of the article.

    author*

    Stores the id of the author.

    story

    Stores the body of the article.

    s_date

    Stores the date that the article was written and submitted.


    * This field creates a link to the yet-to-be-discussed authors table. This type of field is referred to as the "foreign key."

    The authors table stores information about the author. It has the following fields:


    Field

    Description

    aid*

    Stores the ID of the author.

    name

    Stores the name of the author.

    * The aid field is an auto generated number that links to the author field that is in the stories table.

    Finally, the users table is responsible for holding information about the users of the system. This table is mainly used to authenticate users of the Content Management System. It has the following fields:

    Fields

    Description

    uid

    Stores a unique ID for each user.

    uname

    Holds the user's name.

    U pass

    Holds the user's password.

    level

    Stores the user's access level.


    In the following section, I will show you the SQL for all of the tables above.

    More PEAR Articles Articles
    More By David Web


       · This is what pear.php.net says about the DB Package:This package has been...
     

    PEAR ARTICLES ARTICLES

    - Deleting Authors from a PEAR Content Managem...
    - PEAR CMS: Index and Delete Scripts
    - Listing Articles for a PEAR Content Manageme...
    - Building an Authors Page for a PEAR CMS
    - Building the View Details Page in a PEAR CMS
    - Creating the Main Pages of a PEAR CMS
    - Completing the Login Script for a PEAR CMS
    - User Authentication for a PEAR CMS
    - A PEAR CMS: Examining the Code
    - Building a Content Management System with PE...
    - Installing a PEAR Package
    - My PEAR: The Beginning
    - Using XML_RPC2 with PEAR
    - Using Web Service APIs (Amazon and Yahoo!) w...
    - Database Abstraction with MDB2 from PEAR





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