How to check two values in array mysql using codeigniter -


i'm new codeigniter. having problem checking 2 values in field using model codeigniter.

i'm trying check if "status" value "available" or "notavailable"

i'm using model check 1 value. 'available' only.

public function withdraw_check($data) {     $this->db->select('game');     $where = array('id_user' => $this->session->userdata('user_id'),                    'status' => 'available',                     'game' => $data,                    'site' => $this->system_library->sitename()                   );     $this->db->where($where); } 

why not use in statement:

$this->db->where_in('status',array('available','notavailable')); 

sql produced:

where status in ('available', 'notavailable') 

final code:

$this->db->select('game'); $this->db->where('id_user',$this->session->userdata('user_id')); $this->db->where_in('status',array('available','notavailable')); $this->db->where('game',$data); $this->db->where('site', $this->system_library->sitename()); 

Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -