Skip to content
Advertisement

How can I Compare multiple ids in where condition

I have multiple ids in my $temp like(7,8,9) and I want to compare there ids in my where condition like $this->db->where_in('c.mr_no',$temp); but it compare only first id

I am trying like this:

Controller:

Model:

I want to compare all 3 ids in where condition.

Advertisement

Answer

I think you are receiving an string from $_GET and hence the comparisions are not working as expected.

Change this

to

and then try. Where_in excepts the parameter to be an array.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement