MySQL
  Home arrow MySQL arrow Page 3 - 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 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
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: Creating a Web Application
By: Brian Vaughn
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 10
    2005-07-27

    Table of Contents:
  • Data Management Made Easy Using Nennius: Creating a Web Application
  • Configuring a Web Application and Defining Its Menu
  • Creating SQL Tables
  • Creating a Nennius Component, Defining the Entry-Point, and the Descriptor File
  • The Component File

  • 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


    Data Management Made Easy Using Nennius: Creating a Web Application - Creating SQL Tables


    (Page 3 of 5 )

    Creating SQL Tables

    In many cases, Nennius will be configured to manage p-existing data. However, this is not the case for our sample application. We will need to create three basic SQL tables: one to hold Nennius users, one to hold the news releases we will be creating, and another to act as a Threshold lookup table. The queries for doing this are shown below:

    -- create basic news table to contain date, title, and body of release
    CREATE TABLE `news` (
      `id` int(3) unsigned zerofill NOT NULL auto_increment,
      `datetime` datetime NOT NULL default '0000-00-00 00:00:00',
      `title` varchar(100) NOT NULL default '',
      `body` text NOT NULL,
      PRIMARY KEY  (`id`)
    );

    -- create nennius user table holding basic information about user record(s)

    CREATE TABLE `users` (
      `id` int(2) unsigned zerofill NOT NULL auto_increment,
      `username` varchar(35) NOT NULL default '',
      `password` varchar(35) NOT NULL default '',
      `name` varchar(35) NOT NULL default '',
      `email` varchar(35) NOT NULL default '',
      `threshold_id` int(2) unsigned zerofill NOT NULL default '00',
      PRIMARY KEY  (`id`),
      KEY `threshold_id` (`threshold_id`)
    );

    -- insert default user (for demo purposes) of 'admin' w/ password 'admin'
    INSERT INTO `users` VALUES (01, 'admin', 'admin', 0, 'admin@corporatewebsite.com', 06);

    -- create threshold lookup table
    CREATE TABLE `thresholds` (
      `id` int(2) unsigned zerofill NOT NULL auto_increment,
      `name` varchar(25) NOT NULL default '',
      `value` int(3) unsigned NOT NULL default '0',
      PRIMARY KEY  (`id`)
    );

    -- insert all Nennius-supported threshold types into lookup table
    INSERT INTO `thresholds` VALUES (01, 'PUBLIC', 0);
    INSERT INTO `thresholds` VALUES (02, 'CLIENT', 10);
    INSERT INTO `thresholds` VALUES (03, 'USER', 30);
    INSERT INTO `thresholds` VALUES (04, 'REVIEWER', 50);
    INSERT INTO `thresholds` VALUES (05, 'MANAGER', 70);
    INSERT INTO `thresholds` VALUES (06, 'ADMIN', 90);

    As you can see, the structures for our news releases and users tables are fairly basic. The threshold table may not be as intuitive, but we will take a closer at this in Part 3. For now we will continue on to setup our application.

    More MySQL Articles
    More By Brian Vaughn


       · Again, thank you for reading through this article. I hope that part two of this...
     

       

    MYSQL ARTICLES

    - 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...
    - 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





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