CodeIgniter CRUD Operations with MySQL

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 the 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 the database using DELETE SQL statements. We have covered this tutorial with a 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.