I have a PHP PDO connection with two databases, however, I'm having problems with the special characters of both. How to solve?
$host = "localhost";
$user = "user";
$password = "";
$database1 = "bd1";
$database2 = "bd2";
try {
$dbh1 = new PDO("mysql:host=$host;dbname=$database1", $user, $password);
} catch(PDOException $e) {
die('Could not connect to the database:' . $e);
}
try {
$dbh2 = new PDO("mysql:host=$host;dbname=$database2", $user, $password);
} catch(PDOException $e) {
die('Could not connect to the database:' . $e);
}
?>