PEAR Articles
  Home arrow PEAR Articles arrow Page 3 - 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 - Tables


    (Page 3 of 4 )

    Author's Table

    # phpMyAdmin SQL Dump

    # version 2.5.7-pl1

    # http://www.phpmyadmin.net

    #

    # Host: localhost

    # Generation Time: Jun 28, 2008 at 02:05 PM

    # Server version: 5.0.51

    # PHP Version: 5.2.6

    #

    # Database : `cms`

    #


    # --------------------------------------------------------


    #

    # Table structure for table `authors`

    #


    CREATE TABLE `authors` (

    `aid` int(4) NOT NULL auto_increment,

    `name` varchar(20) NOT NULL,

    PRIMARY KEY (`aid`)

    ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;


    #

    # Dumping data for table `authors`

    #


    INSERT INTO `authors` VALUES (1, 'David Web');

    INSERT INTO `authors` VALUES (2, 'Joe Blogg');

    INSERT INTO `authors` VALUES (3, 'John Smith');

    INSERT INTO `authors` VALUES (4, 'Jane Blogg');

     Stories Table

    # phpMyAdmin SQL Dump

    # version 2.5.7-pl1

    # http://www.phpmyadmin.net

    #

    # Host: localhost

    # Generation Time: Jun 28, 2008 at 02:07 PM

    # Server version: 5.0.51

    # PHP Version: 5.2.6

    #

    # Database : `cms`

    #


    # --------------------------------------------------------


    #

    # Table structure for table `stories`

    #


    CREATE TABLE `stories` (

    `sid` int(4) NOT NULL auto_increment,

    `title` varchar(20) NOT NULL default '',

    `author` int(4) default NULL,

    `story` text NOT NULL,

    `s_date` date NOT NULL default '0000-00-00',

    PRIMARY KEY (`sid`)

    ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;


    #

    # Dumping data for table `stories`

    #


    INSERT INTO `stories` VALUES (1, 'PEAR: easy as pie!', 4, 'Rapiebant me spectacula theatrica, plena imaginibus miseriarum mearum et fomitibus ignis mei. quis est, quod ibi homo vult dolere luctuosa et tragica, quae tamen pati ipse nollet? et tamen pati vult ex eis!rnrnRapiebant me spectacula theatrica, plena imaginibus miseriarum mearum et fomitibus ignis mei. quis est, quod ibi homo vult dolere luctuosa et tragica, quae tamen pati ipse nollet? et tamen pati vult ex eis!rnrnRapiebant me spectacula theatrica, plena imaginibus miseriarum mearum et fomitibus ignis mei. quis est, quod ibi homo vult dolere luctuosa et tragica, quae tamen pati ipse nollet? et tamen pati vult ex eis!rn', '2008-06-25');

    INSERT INTO `stories` VALUES (2, 'Connecting with PEAR', 3, 'Rapiebant me spectacula theatrica, plena imaginibus miseriarum mearum et fomitibus ignis mei. quis est, quod ibi homo vult dolere luctuosa et tragica, quae tamen pati ipse nollet? et tamen pati vult ex eis!', '2008-06-25');

    INSERT INTO `stories` VALUES (3, 'The great connection', 2, 'Rapiebant me spectacula theatrica, plena imaginibus miseriarum mearum et fomitibus ignis mei. quis est, quod ibi homo vult dolere luctuosa et tragica, quae tamen pati ipse nollet? et tamen pati vult ex eis!', '2008-06-25');

     Users Table

    # phpMyAdmin SQL Dump

    # version 2.5.7-pl1

    # http://www.phpmyadmin.net

    #

    # Host: localhost

    # Generation Time: Jun 28, 2008 at 02:07 PM

    # Server version: 5.0.51

    # PHP Version: 5.2.6

    #

    # Database : `cms`

    #


    # --------------------------------------------------------


    #

    # Table structure for table `users`

    #


    CREATE TABLE `users` (

    `uid` int(4) NOT NULL auto_increment,

    `uname` char(8) NOT NULL,

    `upass` char(8) NOT NULL,

    `level` varchar(8) NOT NULL,

    PRIMARY KEY (`uid`)

    ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;


    #

    # Dumping data for table `users`

    #


    INSERT INTO `users` VALUES (1, 'david', 'pass', 'admin');

    INSERT INTO `users` VALUES (2, 'John', 'pass', 'normal');

    Simply copy and paste this information into your database client and run the code. The tables will be created for you. Also, because security is not what we are focusing on at this point, I've not taken precautions as regards to password encryption and the like. You will need to take this into consideration if you want to use this application seriously.

    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 2 Hosted by Hostway
    Stay green...Green IT