The Canonical Blog Tutorial

In order to illustrate the features of Pox, we will conduct the classical framework tutorial in creating a blog system.

The blog system will be able to:

Create the database

First, though, we'll need to create the database. Run the following script.

blog_db.sql

CREATE DATABASE blogs;
USE blogs;
 
 
CREATE TABLE `comments` (
  `comment_id` int(11) NOT NULL AUTO_INCREMENT,
  `post_id` varchar(100) collate latin1_general_ci NOT NULL DEFAULT '',
  `name` varchar(100) collate latin1_general_ci NOT NULL DEFAULT '',
  `comment` varchar(100) collate latin1_general_ci NOT NULL DEFAULT '',
  `create_dt_tm` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY  (`comment_id`)
) ENGINE=INNODB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; 
 
 
CREATE TABLE `posts` (
  `post_id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(100) collate latin1_general_ci NOT NULL DEFAULT '',
  `body` varchar(100) collate latin1_general_ci NOT NULL DEFAULT '',
  `create_dt_tm` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY  (`post_id`)
) ENGINE=INNODB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; 
 
 
INSERT INTO `posts` VALUES (NULL, 'My First Post', 'This is my first post.', NOW());

Back to project page

pox-php/the_canonical_blog_tutorial.txt · Last modified: 2010/05/09 20:31 by gerard
 
 
© 2010 Straylightrun.net under Creative Commons Attribution
Green hosting by Dreamhost.com | Powered by DokuWiki