Rudimentary support for table prefixing #1
This commit is contained in:
@@ -57,6 +57,10 @@ class Wrapper{
|
||||
|
||||
public static function get_table($name){
|
||||
$instance = self::getInstance();
|
||||
echo $instance->_adapter->getConnection()->prefix;
|
||||
if( $instance->_adapter->getConnection()->prefix ){
|
||||
$name = $instance->_adapter->getConnection()->prefix . $name;
|
||||
}
|
||||
return new Table($name, Array(), $instance->_adapter);
|
||||
}
|
||||
|
||||
@@ -72,6 +76,7 @@ class Wrapper{
|
||||
|
||||
public static function exec($sql){
|
||||
$instance = self::getInstance();
|
||||
$sql = preg_replace('/{(.*)}/', "$con->prefix$1", $sql);
|
||||
$instance->_driver->exec($sql);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user