CodeIgniter Insert Data into Database

CodeIgniter gives you access to a Query Builder class. This pattern allows information to be retrieved, inserted, and updated in your database with minimal scripting. In some cases only one or two lines of code are necessary to perform a database action.

CodeIgniter Insert Data into Database

In this tutorial we will understand how to Save Records inside database using CodeIgniter Core Library. Here we are going to use student table to Save Records and Check user's existence. This is student table structure

Table Name : student
student_id int primary key auto_increment
name char(50)
email varchar(100)
password varchar(100)
mobile bigint
course char(100)

Controller

Copy the below given code in your User Controller.


Registration View



Enter Your Name
Enter Your Email
Enter Your Password
Enter Your Mobile
Select Your Course