In this tutorial, you can learn CRUD operations in Codeigniter and MySQL. CRUD stands for create, read, update and delete. Create means inserting data into database using INSERT SQL statement. Read means reading data from database using SELECT SQL statement. Update means updating records using UPDATE SQL query. Finally, Delete means deleting data from database using DELETE SQL statements.We have covered this tutorial with live demo to create CRUD operations with Codeigniter and MySQL.

Step 1: Create MySQL Database and Table

Step 2: Create a model file
Create a model file named “Curd_model.php” inside “application/models” folder.

Step 3: Create a controller file
Next create a controller file named “Curd.php” inside “application/controllers” folder.

Step 4: Change Route file
So open “application/config/routes.php” file and add code like as bellow:

Step 5: Create a view
Create a view file named “add.php” inside “application/views/emp” folder

Step 6: Create a view
Create a view file named “index.php” inside “application/views/emp” folder

Step 7: Create a view
Create a view file named “edit.php” inside “application/views/emp” folder

Step 8: Create a view
Create a view file named “display.php” inside “application/views/emp” folder

Demo  

Leave a Reply

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

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">