SunQuest
 
       MySQL
  Home arrow MySQL arrow Data Management Made Easy Using Nenniu...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
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? 
MYSQL

Data Management Made Easy Using Nennius: Advanced Data Handling
By: Brian Vaughn
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 6
    2005-08-03

    Table of Contents:
  • Data Management Made Easy Using Nennius: Advanced Data Handling
  • Advanced Application Configuration
  • Expanding Our Application Menu
  • Creating the User Comments Component
  • Creating Component Dependencies
  • Component Notes
  • Help Files
  • File Attachments

  • 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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Data Management Made Easy Using Nennius: Advanced Data Handling


    (Page 1 of 8 )

    Welcome to part three of this tutorial introducing application development for the Nennius engine. In this article, we will enhance the News Manager application from part two.

    Introduction

    This article is part three of an introduction to application development for the Nennius engine. If you have not yet read part one or two, you should do so before continuing. We will be enhancing the News Manager application (http://nennius.sourceforge.net/nennius/webapps/news/) already discussed in the previous tutorial, so you will need a copy of the source code (http://nennius.sourceforge.net/nennius/webapps/news.zip) for that application if you want to work along.

    Update Database

    Before we can start, we will once again need to run a few SQL queries to populate the application's database with the appropriate information. These queries simply build on top of the database created in part two:

    -- create table to hold news release file attachments (images in this case)

    CREATE TABLE `news_attachments` (

            `id` INT( 4 ) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT ,

            `news_id` INT( 3 ) UNSIGNED ZEROFILL NOT NULL ,

            `filename` VARCHAR( 50 ) NOT NULL ,

            PRIMARY KEY ( `id` ) ,

            INDEX ( `news_id` )

    );

    -- create table to hold record history (& associate to users & news tables via foreign keys)

    CREATE TABLE `news_history` (

            `id` INT( 4 ) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT ,

            `news_id` INT( 3 ) UNSIGNED ZEROFILL NOT NULL ,

            `user_id` INT( 2 ) UNSIGNED ZEROFILL NOT NULL ,

            `datetime` DATETIME NOT NULL ,

            `description` TEXT NOT NULL ,

            PRIMARY KEY ( `id` ) ,

            INDEX ( `news_id` , `user_id` )

    );

    -- create comments table to hold user comments

    CREATE TABLE `comments` (

            `id` INT( 10 ) UNSIGNED ZEROFILL NOT NULL ,

            `news_id` INT( 3 ) UNSIGNED ZEROFILL NOT NULL ,

            `datetime` DATETIME NOT NULL ,

            `name` VARCHAR( 50 ) NOT NULL ,

            `subject` VARCHAR( 100 ) NOT NULL ,

            `comment` TEXT NOT NULL ,

            PRIMARY KEY ( `id` ) ,

            INDEX ( `news_id` )

    );

    -- create notes table for moderators store private messages regarding user comments in

    CREATE TABLE `comment_notes` (

            `id` int(4) unsigned zerofill NOT NULL auto_increment,

            `news_id` int(3) unsigned zerofill NOT NULL default '000',

            `user_id` int(2) unsigned zerofill NOT NULL default '00',

            `datetime` datetime NOT NULL default '0000-00-0000:00:00',

            `description` text NOT NULL,

            PRIMARY KEY  (`id`),

            KEY `news_id` (`news_id`,`user_id`)

    );

    -- insert addition user record with threshold of USER for later use

    INSERT INTO `users` ( `id` , `username` , `password` , `name` , `email` , `threshold_id` )

            VALUES ( '', 'user', 'user', '', 'user@corporatewebsite.com', '03' );

    As you can see, we've created several additional SQL tables (which will be explained later in the article) as well as an additional user record; nothing too complex. Now we're ready to start modifying our application.

    More MySQL Articles
    More By Brian Vaughn


       · This is the third and final article in this series, and I thank all of you who have...
     

       

    MYSQL ARTICLES

    - 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...
    - Building a Search Engine with MySQL and PHP 5
    - Using Boolean Operators for Full Text and Bo...
    - PHP, MySQL and the PEAR Database
    - Working with PHP and MySQL
    - Getting PHP to Talk to MySQL
    - Creating an RSS Reader: the Reader
    - MySQL Security Overview
    - Creating the Admin Script for a PHP/MySQL Bl...
    - Creating the Blog Script for a PHP/MySQL Blo...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway