I have and array with two values and I want to use it with sql IN operator in select query.
Here is the structure of my table
id comp_id 1 2 2 3
As per @barryhunter 's answer which works only on array that contains integer only:
$sql = "SELECT * from table Where comp_id IN (".implode(',',$arr).")";
I've made some tweaks to make it work for array of strings:
$sql = "SELECT * from table Where comp_id IN ('".implode("','",$arr)."')";