$dbname = "";
$username = "";
$passwd = "";
try {
$db = new PDO("mysql:host=localhost;dbname=$dbname", "$username", "$passwd", array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
}
catch(PDOException $e){
print $e->getMessage();
}
$dbname = "";
$username = "";
$passwd = "";
try {
$db = new PDO("mysql:host=localhost;dbname=$dbname", "$username", "$passwd", array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
}
catch(PDOException $e){
print $e->getMessage();
}