Create a simple blog using CodeIgniter 2 – Part 1

CodeIgniter Logo

This entry will demonstrate to you on how to code a simple blog by using CodeIgniter 2. You may use whatever web server environment that you prefer such as Xampp, Lamp, Wamp, or Mamp. In this tutorial, I would like to use Wamp.

At the end of the tutorial, you should have a simple blog system with comment function. To download the complete source code, scroll down to the end of this tutorial. You also may want to view the final product first.

1. Setup a database

In the database named as blog, we will create a table, table ENTRY. The ENTRY table has columns such as entry_id, entry_name, entry_body, and entry_date (This is just a sample). The code is as below:

CREATE TABLE IF NOT EXISTS `entry` (
`entry_id` int(11) NOT NULL AUTO_INCREMENT,
`entry_name` varchar(255) NOT NULL,
`entry_body` text NOT NULL,
`entry_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`entry_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

Continue reading “Create a simple blog using CodeIgniter 2 – Part 1”