0

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

1
  • Use $this->db->where_in(). Commented Feb 14, 2014 at 18:33

1 Answer 1

1

You can use 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');
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.