Codeigniter Update Query Using Where Condition

Codeigniter Update Query Using Where Condition

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

so you can see the following two ways for Codeigniter update 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 an update() Query method. so here we can directly pass data without a model. see the 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 an update() Query method. so you can see following below example.

application/controller/Product.php

application/models/Product_model.php

Please follow and like us: