1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
<?PHP
if(!defined('DB_INC')) {
define('DB_INC', 1);
include('config/config.inc.php');
include('adodb.inc.php');
class DB {
var $conn;
function DB($driver, $server, $user, $passwort, $database) {
$this->conn = ADONewConnection($driver);
$this->conn->PConnect($server, $user, $passwort, $database);
}
function Query($query, $args = null) {
$sql = $this->conn->Prepare($query);
return $this->conn->Execute($sql, $args);
}
function InsertID() {
return $this->conn->Insert_ID();
}
}
$db = new DB($config['driver'], $config['server'], $config['user'],
$config['password'], $config['db']);
}
?>
|