summaryrefslogtreecommitdiffstats
path: root/code/db.inc.php
blob: 3f5c444ebe2045e2db83ca37326a066be221e2f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?PHP
  if(!defined('DB_INC')) {
    define('DB_INC', 1);
    
    include('config/config.inc.php');
    
    include('adodb.inc.php');
    
    $conn = ADONewConnection($config['driver']);
    $conn->PConnect($config['server'], $config['user'], $config['password'], $config['db']);
    
    function DBQuery($query, $args = null) {
      $sql = $GLOBALS['conn']->Prepare($query);
      return $GLOBALS['conn']->Execute($sql, $args);
    }
    
    function DBInsertID() {
      return $GLOBALS['conn']->Insert_ID();
    }
  }
?>