I have a value of $completedId="1,2,3,4,5";
When I run this query in phpmyadmin, it gives the perfect output which is 6,7,8,9,10.
select cmp_id from comprehension_master where cmp_id NOT in(1,2,3,4,5);
But when I run the below given query in php, it shows output as 2,3,4,5,6,7,8,9,10.
Query only is being executed for value 1.
$completedId="1,2,3,4,5";
$query="select cmp_id from comprehension_master where cmp_id NOT in('".$completedId."')";
$result=$con->query($query);
$cnt=0;
while($row=$result->fetch_array()){
$cmpId[$cnt]=$row[0];
$cnt++;
}
$cnt=0;
print_r($cmpId);
Please help me.