2
Yes, I have a code snippet supporting this:
in class/database/sqlutility.php, replace prefixQuery() function with this:
/**
* add a prefix.'_' to all tablenames in a query
*
* @param string $query valid SQL query string
* @param string $prefix prefix to add to all table names
* @return mixed FALSE on failure
*/
function prefixQuery($query, $prefix)
{
$pattern = "/^(INSERT INTO|CREATE TABLE|ALTER TABLE|UPDATE)(s)+([`]?)([^`s]+)\3(s)+/siU";
$pattern2 = "/^(DROP TABLE)(s)+([`]?)([^`s]+)\3(s)?$/siU";
$pattern3 = "/(REFERENCES)(s)+([`]?)([^`s]+)\3/iU";
if (preg_match($pattern, $query, $matches) || preg_match($pattern2, $query, $matches)) {
$replace = "\1 ".$prefix."_\4\5";
$matches[0] = preg_replace($pattern, $replace, $query);
$matches[0] = preg_replace($pattern3, $replace, $matches[0]);
return $matches;
}
return false;
}
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."
Cusix Software