Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I need to target rows where their id is in a flat array.
For example,
$array = (1,2,67,102,178,678);
after query I need rows where id=1,id=2,id=67,id=102,id=178,id=678
and I want update records this condition
$this->db->where_in()
You can use where_in:
where_in
$this->db->where_in('id', $array);
To retrieve the records use:
$this->db->get('table_name')->result();
To update the records use:
$this->db->update('table_name');
Add a comment
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
$this->db->where_in().