I use in_array()
to check whether a value exists in an array like below,
But does not work as expected:
$projectId = $_GET['projectId'];
$userId = $_GET['userId'];
$qr2 = mysql_query("SELECT `userId`,`status` FROM `fndn_ProjectBacker` WHERE `projectId`='$projectId' && `status`='1'");
for($i = 1; $row2 = mysql_fetch_assoc($qr2); $i++) {
$arr1[$i] = array($row2);
}
if (in_array($userId, $arr1)) {
echo "True";
}
plz help me!