I want to use IN operator in sql query please suggest the correct syntax. code snippest is just example.
Problem is who to use $selectedusers[] array in Query using IN operator.
[COLOR=“SeaGreen”] $sql = “select userid from tblprojuser where projid = ‘$sprojid’”;
$result = mysqli_query($link, $sql);
while ($row = mysqli_fetch_array($result))
{$selectedusers[] = $row['userid'];}[/COLOR]
[SIZE="4"]//selecte all application users excluding those in [COLOR="red"]$selectedusers[][/COLOR] array
[COLOR="Red"]$sql = "select id, username, status from tbluser where id NOT IN ($selectedusers)"; [/COLOR][/SIZE]