* Modify dbh tableExists func.

This commit is contained in:
songchenxuan
2023-06-13 11:28:07 +08:00
parent e09d6829bc
commit a701fc6f75
+3 -2
View File
@@ -151,11 +151,12 @@ class dbh
public function tableExits($tableName)
{
$tableName = str_replace('`', "'", $tableName);
$sql = "SHOW TABLES FROM {$this->config->name} like $tableName";
$tableName = str_replace("'", "", $tableName);
$sql = "SHOW TABLES FROM {$this->config->name} like '{$tableName}'";
switch($this->config->driver)
{
case 'mysql':
$sql = "SHOW TABLES FROM {$this->config->name} like {$tableName}";
$sql = "SHOW TABLES FROM {$this->config->name} like '{$tableName}'";
break;
case 'dm':
$sql = "SELECT * FROM all_tables WHERE owner='{$this->config->name}' AND table_name='{$tableName}'";