where_in method unexpected query |
Hi,
I have a query like this Code: $this->db->where_in('chat_session', $latest_sessions)->update('chat_state', $update_state); which generating following result UPDATE `chat_state` SET `status` = 'exit' WHERE `chat_session` IN('55_6_11,30_6_2') But I need following query UPDATE `chat_state` SET `status` = 'exit' WHERE `chat_session` IN('55_6_11','30_6_2') I have tried following still not working Code: $this->db->where_in('chat_session', $latest_sessions,NULL)->update('chat_state', $update_state); and Code: $this->db->where_in('chat_session', $latest_sessions,FALSE)->update('chat_state', $update_state);
The largest Bengali tutorial site on Web Development in this planet
is $latest_sessions an array? or is a string?. Do an echo. Does it output: '55_6_11 , 30_6_2'? if it does, then you know is not an array...
Website: http://avenir.ro
Seems like the following will do the trick. As Avenirer mentioned, it's most likely not an array.
$this->db->where_in('chat_session', explode(',', $latest_sessions))->update('chat_state', $update_state); |
Welcome Guest, Not a member yet? Register Sign In |