Although I have a database, I get the following error.
SQLSTATE[HY000] [1049] Unknown database 'hascodin_site'
php connection code
>
$baglanti = "mysql:host=localhost;dbname=hascodin_site";
$mysqluser = "root";
$mysqlpass = "";
try{
$baglan = new PDO($GLOBALS["baglanti"],$GLOBALS["mysqluser"],$GLOBALS["mysqlpass"]);
$baglan->query("SET CHARACTER SET 'utf8'");
$baglan->query("SET NAMES 'utf8'");
}catch(PDOException $e){
print $e->getMessage();
}
<
SQLSTATE[HY000] [1049] Unknown database 'hascodin_site'
php connection code
>
$baglanti = "mysql:host=localhost;dbname=hascodin_site";
$mysqluser = "root";
$mysqlpass = "";
try{
$baglan = new PDO($GLOBALS["baglanti"],$GLOBALS["mysqluser"],$GLOBALS["mysqlpass"]);
$baglan->query("SET CHARACTER SET 'utf8'");
$baglan->query("SET NAMES 'utf8'");
}catch(PDOException $e){
print $e->getMessage();
}
<