Difference between revisions of "DesignPatternStep1"
From mi-linux
Jump to navigationJump to searchLine 20: | Line 20: | ||
(2, 'Test 2', 'Hiya', '2009-07-27 15:06:38'); | (2, 'Test 2', 'Hiya', '2009-07-27 15:06:38'); | ||
</pre> | </pre> | ||
+ | |||
+ | This is what you should be seeing on your screen: | ||
[[Image:6cc001-patterns-mysql1.gif]] | [[Image:6cc001-patterns-mysql1.gif]] | ||
>> Onto [[DesignPatternStep2|Step 2]] | >> Onto [[DesignPatternStep2|Step 2]] |
Latest revision as of 15:53, 12 July 2011
Main Page >> Advanced Web Technologies >> Workbook >> Week 04 >> Step 1 - Create and populate database
Step 1 - Create and populate database
First, let’s create a very simple table to store our blog messages.
The following SQL code will create the table and populate it with a couple of dummy records. Simply paste it and run it in phpmyadmin.
CREATE TABLE IF NOT EXISTS `messages` ( `id` int(11) NOT NULL auto_increment, `title` varchar(255) NOT NULL, `message` text NOT NULL, `date_added` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=19 ; INSERT INTO `messages` (`id`, `title`, `message`, `date_added`) VALUES (1, 'Test 1', 'Hello world!', '2009-07-27 15:06:29'), (2, 'Test 2', 'Hiya', '2009-07-27 15:06:38');
This is what you should be seeing on your screen:
>> Onto Step 2