File name
Commit message
Commit date
File name
Commit message
Commit date
<?php
class DB
{
private $user = "root";
private $password = "1234";
private $option = array(PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION);
private $db;
public function __construct(){
try {
$this->db = new PDO("mysql:host=localhost;dbname=study", $this->user, $this->password, $this->option);
}catch (PDOException $e){
echo "<h2>Database Connection FAIL!!</h2>";
echo "Because : " . $e . "<hr>";
}
}
public function getDB() {
return $this->db;
}
}