Codeigniter Delete Query with example

Codeigniter Delete Query with example

In this exam, we will discuss about how to delete a record or data (Codeigniter Delete Query with example) from the MySQL database using the CodeIgniter framework. so we can easily delete data into the database using the Delete Query method.

so you can see the following two ways for Codeigniter delete database record.

Without Use Model
In this step, first, we will load the database library in the controller or directly load in the “application/config/autoload.php” file and pass the data into a delete() Query method. so here we can directly pass data without a model. see following below example.

application/controller/Product.php

With Use Model
In this step, first, we will load the database library in the model or directly load in the “application/config/autoload.php” file and pass the data into a delete() Query method. so you can see following below example.

application/controller/Product.php

application/models/Product_model.php

Please follow and like us: