- Committed Moshe's selective table rewriting patch. Makes it possible to

share some database tables but not others.
4.3.x
Dries Buytaert 2003-08-26 06:44:37 +00:00
parent 410d619287
commit b77272279e
1 changed files with 12 additions and 1 deletions

View File

@ -4,7 +4,18 @@
function db_prefix_tables($sql) {
global $db_prefix;
return strtr($sql, array("{" => $db_prefix, "}" => ""));
if (is_array($db_prefix)) {
$prefix = $db_prefix["default"];
foreach ($db_prefix as $key => $val) {
if ($key !== "default") {
$sql = strtr($sql, array("{". $key. "}" => $val. $key));
}
}
}
else {
$prefix = $db_prefix;
}
return strtr($sql, array("{" => $prefix, "}" => ""));
}
$db_type = substr($db_url, 0, strpos($db_url, "://"));