Question : codeigniter 3 update
Answered by : alberto-peripolli
$data = array( 'title' => $title, 'name' => $name, 'date' => $date
);
$this->db->where('id', $id);
$this->db->update('mytable', $data);
Source : | Last Update : Fri, 13 Nov 20
Question : update codeigniter
Answered by : eula-mae-barcelona
$this->db->set('fieldname', 'value');
$this->db->where('id', 2);
$this->db->update('tablename');
Source : | Last Update : Thu, 21 Oct 21
Question : cideigniter orLike()
Answered by : sameh-shahin
$this->db->like('title', 'match'); $this->db->or_like('body', $match);
// WHERE `title` LIKE '%match%' ESCAPE '!' OR `body` LIKE '%match%' ESCAPE '!'
Source : https://codeigniter.com/userguide3/database/query_builder.html | Last Update : Tue, 27 Oct 20
Question : codeigniter select for update
Answered by : portapipe
$table = "my_table";
$id = 1;
$update = ["status"=>"working"];
//Edit just above /\ if you don't need extra "where" clause
$query = $this->db->select() ->from($table) ->where('id', $id) ->get_compiled_select();
$data = $this->db->query("$query FOR UPDATE")->row_array();
$this->db->where('id', $data['id'])->update($table,$update);
Source : | Last Update : Fri, 09 Oct 20