I'm facing a problem with IN() clause in a PHP script, i receive data from another page in a POST request as follow :
if( isset($_POST['mycountry'])){
if($_POST['mycountry']) $where[] = 'pays in ( :pays )';
};
$_POST['mycountry'] : contain the countries selected by the user (user can select zero or many countries)
If the user select country/countries, i add the concerned column and the values(countries) to the IN clause.
if(isset($_POST['mycountry'])){
$tags = implode(', ', $_POST['mycountry']);
$stmt->bindParam(':pays', $tags, PDO::PARAM_BOOL);
}
When the user select zero or only one country it work fine, once the user choose more than one it return nothing!!
Any idea ?