CRUD application with codeigniter

Codeigniter is my favorite php framework. I think all php developers like the codeigniter. This is very small in size and very fast in performance. You can read about codeigniter here.

Here I am going to write article about crud application with codeigniter. In this article, we will learn that how we can install codeigniter on localhost and how we can perform create, read, update and delete operation with codeigniter with example code.

Before proceeding to write code, first we will understand the example. So let’s start to learn simple crud application with codeigniter.

  • Download codeigniter from here and extract in your localhost.
  • Rename the folder to Browse the url like : http://localhost/crud
  • When you browse the url, you will see following screen

This is default welcome screen. Here I have assumed that you have basic understanding of MVC design pattern. Now we will perform that custom coding that will complete our article.

  • Import the sql file in your database.
  • Create Users.php file in application/controller folder and add the following code.

  • Create User.php file in application/models folder and add the following code.

  • Create user and common folder in application/views.
  • Add index.php, add.php and edit.php in user folder respectively.

  • Add header.php, footer.php file in common folder respectively.

  • Perform the necessity changes in application/config/database.php

When you have done all things, you will see the following screen.