Hi, I got a php array: $a= array( [0]=>5, [1]=>2, [2]=>10 ); I need to get some results from mysql where "id" field is not one of those in array. mysql_query(" select * from table where some_field='ok' and id!=' values of array ' "); I am not getting the idea on how to make the query so it's quick and gets me desired results. Please help. Thanks
$sql = "SELECT * FROM table WHERE some_field='ok' AND id NOT IN(" . implode(",", array_values($a)) . ')'; mysql_query($sql);