Data Insertion in CodeIgniter

In this tutorial we will learn about how to insert data into database in codeIgniter.

1.Create a database then configure your db credential in application/database.php

2. load some libraries and helpers in application/autoload.php

  • Database library used for database related queries
  • Session library  used for display success / error message using flashdata.
  • Html Helper for used for link_tag
  • form helper used for form

First create a  view(registration.php) inside application/view folder

Now create a controller (Registration.php) inside application/controller. You can also set your default controller in application/routes.php

Create a model (Registration_Model.php) inside application/model.

SQL Table structure for tblusers

View Demo———————————————–

View Demo

How to run this script

  1. Download the zip file .
  2. Extract the zip and copy registrationci folder
  3. Paste in root directory(For xampp htdocs and for wamp www)
  4. Open your browser put http://localhost/phpmyadmin
  5. Create a database cidb
  6. Import sql file tblusers.sql
  7. Run your script http://localhost/registrationci

Data Insertion in CodeIgniter (Download full source code)
Size: 2.76 MB
Version: v 1

Anuj Kumar

I'm Anuj kumar a web developer with 4+ year experience .I write blogs in my free time. I love to learn new technologies and share with others. I founded PHPGurukul in September 2015. The main aim of this website to is provide php , jquery , mysql , phpoops and other web development tutorials. I am trying best effort to make PHPGurukul useful for every single moment spend on this website. If you think this website is useful to visit please share with your friend and buddies.

Recommended Tutorials for you

You may also like...

Leave a Reply

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