Limit 1 update in the code uses active record

I am trying to update one record with the active codeigniter record and it still fails.

$data = array('status' => 1);

$this->db->where('field1', $info);
$this->db->update('example', $data);
$this->db->limit(1);

When I start updating all database fields. Doing $ this-> db-> last_query () won't show me the limit

What is a mistake?

+5
source share
1 answer

Move the limit before the update, which should always be called last:

$this->db->limit(1);
$this->db->update('example', $data);
+9
source

All Articles