Posted inphp / Codeigniter

insert and display data from database in codeigniter

Today, We want to share with you insert data in codeigniter.In this post we will show you codeigniter migration inserts data, hear for add data in database in codeigniter we will give you demo and example for implement.In this post, we will learn about How To Insert Data Into Database With CodeIgniter? with an example.

How to insert data in database – CodeIgniter framework

SQL Query

  `id` int(11) NOT NULL,
  `first_name` varchar(30) NOT NULL,
  `last_name` varchar(30) NOT NULL,
  `email` varchar(30) NOT NULL,

Crud.php (Controller)

	/*load Model*/
	public function storememberinfo()
		/*load registration view form*/
		/*Check submit button */
			        echo "Records Saved Successfully";
					echo "Insert error !";

Crud_model.php (Model)

          return $this->db->insert_id();

insert.php (View)


Registration form


First Name
Last Name
Email ID

Run the program on your browser with URL:


I hope you get an idea about insert data in codeigniter.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

I am Jaydeep Gondaliya , a software engineer, the founder and the person running Pakainfo. I'm a full-stack developer, entrepreneur and owner of I live in India and I love to write tutorials and tips that can help to other artisan, a Passionate Blogger, who love to share the informative content on PHP, JavaScript, jQuery, Laravel, CodeIgniter, VueJS, AngularJS and Bootstrap from the early stage.

Leave a Reply

Your email address will not be published. Required fields are marked *

We accept paid guest Posting on our Site : Guest Post Chat with Us On Skype