Funguje mi ve všech aplikacích tento kód:
try
{
$dbh = new PDO("mysql:host=$this->MySQL_server;dbname=$this->MySQL_databaze;charset=utf8", $this->MySQL_uzivatel , $this->MySQL_uzivatel_password ,
array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8" ,
)
);
}
catch(PDOException $e)
{
echo $e->getMessage();
}