Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class config{
- private $host = "localhost";
- private $user = "root";
- private $pass = "";
- private $dbnm = "smartschool";
- private $dbms = "mysql";
- public $conn;
- public function getConnection(){
- $this->conn = null;
- try{
- $this->conn = new PDO($this->dbms.":host=".$this->host.";dbname=".$this->dbnm,$this->user,$this->pass);
- } catch(PDOException $exception){
- echo "Koneksi Error... ".$exception->getMessage();
- }
- return $this->conn;
- }
- }
- ?>
Add Comment
Please, Sign In to add comment