Bunun onlarca sebebi olabilir. Sorunu daha iyi ele alabilmemiz için kod örneklerini paylaşabilirseniz iyi olur.
ayar.php
<?php
try{
$vt = new PDO(
"mysql:host=localhost;dbname=blog;charset=utf8;"," root","************");
}catch(PDOExeption $turcover){
echo $turcover->getMessage();
}
?>
index.php
<!DOCTYPE html>
<html>
<head>
<title>Anasayfa - MegaS</title>
<link rel="stylesheet" href="css/genel.css">
<meta charset="utf-8" />
</head>
<body>
<?php
include("ayar.php");
$veri = $vt->prepare("selecet * from mesajlar");
$veri->execute();
while($row = $veri->fetch(PDO::FETCH_ASSOC)) {
echo $row["kim"];
}
?>
</body>
</html>