You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
717 B
31 lines
717 B
<?php
|
|
final class DB {
|
|
private $driver;
|
|
|
|
public function __construct($driver, $hostname, $username, $password, $database) {
|
|
if (file_exists(DIR_DATABASE . $driver . '.php')) {
|
|
require_once(DIR_DATABASE . $driver . '.php');
|
|
} else {
|
|
exit('Error: Could not load database file ' . $driver . '!');
|
|
}
|
|
|
|
$this->driver = new $driver($hostname, $username, $password, $database);
|
|
}
|
|
|
|
public function query($sql) {
|
|
return $this->driver->query($sql);
|
|
}
|
|
|
|
public function escape($value) {
|
|
return $this->driver->escape($value);
|
|
}
|
|
|
|
public function countAffected() {
|
|
return $this->driver->countAffected();
|
|
}
|
|
|
|
public function getLastId() {
|
|
return $this->driver->getLastId();
|
|
}
|
|
}
|
|
?>
|