Lost update is a common MySQL issue and to solve it the select query should be edited to be a select for update query like this
select * from users where id = 1 FOR UPDATE
to prevent other users from working on the same row at the same time. I want to do this in codeigniter by editing this query to be a select for update query
public function get_row_data($id)
{
$this->db->where('id',$id);
$result = $this->db->get('users');
if($result && $result->num_rows() > 0)
{
return $result->row();
}
else
{
return false;
}
}
I can use the above simple query but prefer if the model query could be converted.
Thanks