From a701fc6f75c62cb96e0195eabf1ef22141442b5a Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Tue, 13 Jun 2023 11:28:07 +0800 Subject: [PATCH] * Modify dbh tableExists func. --- lib/dbh/dbh.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/dbh/dbh.class.php b/lib/dbh/dbh.class.php index 1740a98493..f8e812741e 100644 --- a/lib/dbh/dbh.class.php +++ b/lib/dbh/dbh.class.php @@ -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}'";