sql update in codeigniter code example
Example 1: update query in codeigniter using where condition
public function update_row(){
$update_rows = array('field-name' => 'field-data',);
$this->db->where('id', 1 );
$this->db->update('table-name', $update_rows);
}
Example 2: codeigniter query builder order by
$this->db->order_by('title', 'DESC');
// Produces: ORDER BY `title` DESC