I've got a big problem:
I'm writing a new WebApp without a Framework. I'm using xampp and sublime text. I dont know how can i solve this problem.
An example how my DB.php written
class DB{
    private static  $_baglan = null;
    private $_pdo,
            $_query,
            $hatalar = false,
            $sonuc,
            $_sayac = 0;
            public function __construct(){
                try{
                    $this -> _pdo = new PDO('mysql:host=' . Config::getir('mysql/host') . ';dbname=' . Config::getir('mysql/db'), Config::getir('mysql/kullanici_adi'), Config::getir('mysql/sifre') );
                    // echo 'baglandi';
                }catch(PDOException $e){
                    die($e->getMessage());
                }
            }
            public static function baglan(){
                if (!isset(self::$_baglan)) {
                    self::$_baglan = new DB();
                    // echo 'baglandi';
                }
                return self::$_baglan;
            }
            public static function query($sql, $parametre=array()){
                $this->_hatalar = false;  // line 32
                if ($this->_query = $this->_pdo->prepare($sql)) {
                    $x = 1;
                    if (count($parametre)) {
                        foreach ($parametre as $param) {
                            $this->_query->bindValue($x, $parametre);
                            $x++;
                        } 
                    }
                    if ($this->_query->execute()) {
                        $this->sonuc=$this->_query->fetchAll(PDO::FETCH_OBJ);
                        $this->_sayac=$this->_query->rowCount();
                    }else{
                        $this->_hatalar=true;
                    }
                }
                return $this;
            }
            public function eylem($eylem, $tablo, $where=array()){
                if (count($where)===3) {
                    $operatorler = array('=', '<', '>', '>=', '<=');
                    $alan = $where[0];
                    $operator = $where[1];
                    $deger = $where[2];
                    if (in_array($operator, $operatorler)) {
                        $sql = "{$eylem} FROM {$tablo} WHERE {$alan} {$operator} ?";
                        if (!$this->query($sql, array($deger))->hatalar()) {
                            return $this;
                        }
                    }
                }
                return false;
            }
            public function getir($tablo, $where){
                return $this->eylem('SELECT *', $tablo, $where);
            }
            public function sil($tablo, $where){
                return $this->eylem('DELETE', $tablo, $where);
            }
            public function hatalar(){
                return $this->hatalar();
            }
}
In my index.php I'm loading maybe
require_once 'core/init.php';
// echo Config::getir('mysql/host');
// calismadi $kullanici = DB::baglan() -> query("SELECT kullanici_adi FROM uye WHERE kullanici_adi = ?", array('oguzhan'));
$kullanici = DB::baglan()->getir('uye', array('kullanici_adi', '=', 'oguzhan'));
if ($kullanici->hatalar()) {
    echo 'Kullanıcı yok';
}else{
    echo 'Var';
}
Why is the error coming?
 
     
     
    