/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
class Database { private static $instance; private $dbName = "mcms"; private $host = "localhost"; private $username = "moroch"; private $password = "w1d33y3"; private $connected; public function __construct() { } public static function getInstance() { if (!self::$instance) { self::$instance = new Database(); } return self::$instance; } public function connect() { try { if (!$this->connected) throw new Exception("Could not connect to MySql server."); } catch (Exception $e) { } } public function selectDB() { } public function execute($sql) { } }