I am having a hard time with this. Although am new here. I am using Codeigniter, This is the query code.
<?php
$is_member = $this->db->query("SELECT user FROM chatroom_members WHERE room='$row->id'");
$check = $is_member->result_array();
if (in_array($id, $check)) {
echo "Match found";
} else {
echo "Match not found";
}
?>
Which outputs Match not found
but print_r($check) gives
Array ( [0] => Array ( [user] => 1 ) [1] => Array ( [user] => 2 )
So how am I going to check if a specific integer is in the array which is multidimensional I think.
Note: $id = 1, which is clearly in the array, but it still saying not found. Any answers? feel free to correct me if am doing something wrong
$id?