database.inc 344 Bytes
Newer Older
Dries's avatar
 
Dries committed
1
<?php
Dries's avatar
 
Dries committed
2 3 4 5 6 7 8
// $Id$

function db_prefix_tables($sql) {
  global $db_prefix;

  return strtr($sql, array("{" => $db_prefix, "}" => ""));
}
Dries's avatar
 
Dries committed
9

Dries's avatar
 
Dries committed
10
$db_type = substr($db_url, 0, strpos($db_url, "://"));
11

Dries's avatar
 
Dries committed
12 13
if ($db_type == "mysql") {
  include_once "includes/database.mysql.inc";
Dries's avatar
 
Dries committed
14
}
Dries's avatar
 
Dries committed
15 16
else {
  include_once "includes/database.pear.inc";
17 18
}

Dries's avatar
 
Dries committed
19
db_connect($db_url);
Dries's avatar
 
Dries committed
20

Dries's avatar
 
Dries committed
21
?>