Timecard/provide/classes/IDB.php
2022-05-22 11:40:31 +09:00

24 lines
443 B
PHP

<?php
class IDB {
public function __construct() {
$this->pdo = null;
}
private $pdo;
public function Connect($host, $name, $user, $pass) {
try {
$this->pdo = new PDO("mysql:dbname=" . $name . ";host=" . $host, $user, $pass);
return true;
} catch (PDOException $e) {
return false;
}
}
public function getDB() {
return $this->pdo;
}
}