diff --git a/includes/database.mysql.inc b/includes/database.mysql.inc
index d892c3e..35e77c7 100644
--- includes/database.mysql.inc
+++ includes/database.mysql.inc
@@ -354,7 +354,14 @@ function db_unlock_tables() {
  *   TRUE if the table exists, and FALSE if the table does not exist.
  */
 function db_table_exists($table) {
-  return (bool) db_fetch_object(db_query("SHOW TABLES LIKE '{". db_escape_table($table) ."}'"));
+  $table = explode('.', db_prefix_tables("{".db_escape_table($table)."}"));
+  if (count($table) > 1) {
+    $query = "SHOW TABLES IN ".$table[0]." LIKE '".$table[1]."'";
+  } else {
+    $query = "SHOW TABLES LIKE '".$table[0]."'";
+  }
+	
+  return (bool) db_fetch_object(db_query($query));
 }
 
 /**
diff --git a/includes/database.mysqli.inc b/includes/database.mysqli.inc
index d678205..e382a37 100644
--- includes/database.mysqli.inc
+++ includes/database.mysqli.inc
@@ -354,7 +354,14 @@ function db_unlock_tables() {
  *   TRUE if the table exists, and FALSE if the table does not exist.
  */
 function db_table_exists($table) {
-  return (bool) db_fetch_object(db_query("SHOW TABLES LIKE '{". db_escape_table($table) ."}'"));
+  $table = explode('.', db_prefix_tables("{".db_escape_table($table)."}"));
+  if (count($table) > 1) {
+    $query = "SHOW TABLES IN ".$table[0]." LIKE '".$table[1]."'";
+  } else {
+    $query = "SHOW TABLES LIKE '".$table[0]."'";
+  }
+  
+  return (bool) db_fetch_object(db_query($query));
 }
 
 /**
