Merhabalar,
session_start hatası alıyordum https://www.r10.net/1061704474-post5.html bu yorumdakileri uyguladım o hata düzeldi ancak 6. satırda tekrar hata gözüküyor.

SQLSTATE[HY000] [1045] Access denied for user 'tadiyaco_kenan'@'localhost' (using password: YES)
[B]Fatal error[/B]: Call to a member function prepare() on null in [B]/home/caticimesut/public_html/idare/giriskontrol.php[/B] on line [B]6[/B]
Yardımcı olabilecek var mı ?

Sayfadaki kodlar

<?php
ob_start();
include ('db.php');
session_start();

$giris = $bag->prepare("select * from yonetim where email=? and pass=?");

if ($_POST) {
    
    $mail = $_POST['mail'];
    $pass = $_POST['pass'];

$giris->execute(array($mail,$pass));
$parcala = $giris->fetch(PDO::FETCH_ASSOC);
$kontrol = $giris->rowCount();
}

if ($kontrol) {

$_SESSION['giris'] = $parcala['email'];
$_SESSION['name'] = $parcala['adi_soyadi'];


    echo "<center><h1>Giriş Başarılı yönlendiriliyorsunuz...</h1>";

    header('refresh:2; url=anasayfa.php');
}else{

    echo header('location:index.php');
}









?>