Timecard/provide/classes/IDB.php

24 lines
442 B
PHP
Raw Normal View History

2022-05-22 15:22:49 +09:00
<?php
2022-05-22 11:40:31 +09:00
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;
}
}