CodeIgniter tutorial: update database

In this tutorial I will explain to you how you can eassily update data in your database by using CodeIgniter Framework.

In my controller, I will create a new function called update:

function update()
{
$data = array("title"=>"New information"); // will update title
$this->db->where("id",1); // works like where id=1
$this->db->update("data",$data);
}

I have a table in my database, called "data" with two columns: id and title.

My function will update the column title where id is 1.

In this way you can easily update your database by using CodeIgniter.

Video tutorial:









Leave a Comment