In the database I have a string like this: Caisse primaire d'assurance maladie
Now when I try to look for it in my PHP script, it returns no items.
$array=array("Caisse primaire d'assurance maladie","Mairies","Hotels");
$in_list = "'".implode("','",$array)."'";
$stmt = $this->db->prepare('SELECT libelle,activite,adresse,tel,lat,lng FROM etablissements where type IN ('.$in_list.')');
$stmt->execute();
$stmt->bind_result($libelle,$activite,$adresse,$tel,$lat,$lng);//the $stmt is empty
Now, if i try to look for Mairies
only or Hotels
only it would return me a result. That mean that the apostrophe is preventing my prepared query from running correctly. How can I fix this?