Priority File Manager

📁 public_html
Base Directory:
/home/ecedu/public_html/new/Models
NameTypeSizeActions
📁 .. Folder -
📄 BasicManager.php File 2087
Edit Download
📄 DB.php File 935
Edit Download
📄 DetailsManager.php File 4312
Edit Download
📄 DeviceAuth.php File 698
Edit Download
📄 Functions.php File 6774
Edit Download
📄 ImageManager.php File 2862
Edit Download
📄 News.php File 13517
Edit Download
📄 NewsModel.php File 9523
Edit Download

View File: DB.php

<?php 
class DB
{
    private static $instance = null;
    private $pdo;

    private function __construct()
    {
        $host = 'localhost';
        $dbname = 'ecedu_ec';
        $user = 'ecedu_ec';
        $pass = 'Fy5?u^7K_^yLXTCD';
        
        try {
            $dsn = "mysql:host=$host;dbname=$dbname;charset=utf8mb4";
            $this->pdo = new PDO($dsn, $user, $pass, [
                PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
                PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC
            ]);
        } catch (PDOException $e) {
            die('Error in databae connection: ' . $e->getMessage());
        }
    }

    public static function instance()
    {
        if (self::$instance === null) {
            self::$instance = new DB();
        }
        return self::$instance;
    }

    public function getConnection()
    {
        return $this->pdo;
    }
}