Hi guys I am trying to select all the users in my database with an array of USER ID. I am coding in PHP and this is my code so far but I get an error saying I am trying to use an array.
$relative = $this->db->select('user_id, fname, surname')->get_where('user_view_view', array('user_id'=>$mytest))->result_array();
My array of user ids is called:
$mytest
What am I doing wrong?
try something like that
$query = $this->db
->select('user_id, fname, surname')
->from("user_view_view")
->where_in("user_id",$myTest)
->get();
$relative = $query->result_array();
the reason why it won't work is because get_where doesn't accept an array as field_value
you should get an error with the message "Array to string conversion"