In this CodeIgniter tutorial, I’m going to show you how to create a blog post with comment function with CodeIgniter 2. You can download the code or just preview the final product first. In this version of code, I’ve created a simple template for our blog.
You can preview the part 1 of this tutorial at Create a simple blog using CodeIgniter 2 – Part 1.
1. Create a table for comment
CREATE TABLE IF NOT EXISTS `comment` ( `comment_id` int(11) NOT NULL AUTO_INCREMENT, `entry_id` int(11) NOT NULL, `comment_name` varchar(255) NOT NULL, `comment_email` varchar(255) NOT NULL, `comment_body` text NOT NULL, `comment_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`comment_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
Continue reading “Create a simple blog using CodeIgniter 2 – Part 2”