aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2009-04-29 13:41:49 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2009-04-29 13:41:49 +0000
commitdd80961b1177b64999956193f5d0cc0b7249c4f2 (patch)
treef98b8e5ad2d7ecd010a8baa1ab30cd1dcb55104b /phpBB
parent2547ca9635a7492ea89fd4de5e3f4fa966a0f911 (diff)
downloadforums-dd80961b1177b64999956193f5d0cc0b7249c4f2.tar
forums-dd80961b1177b64999956193f5d0cc0b7249c4f2.tar.gz
forums-dd80961b1177b64999956193f5d0cc0b7249c4f2.tar.bz2
forums-dd80961b1177b64999956193f5d0cc0b7249c4f2.tar.xz
forums-dd80961b1177b64999956193f5d0cc0b7249c4f2.zip
due to popular demand... this may be quite useful for automatic installer and modifications
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9495 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/db/db_tools.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php
index b1a5d13d26..bc6b027b1f 100644
--- a/phpBB/includes/db/db_tools.php
+++ b/phpBB/includes/db/db_tools.php
@@ -314,6 +314,28 @@ class phpbb_db_tools
}
/**
+ * Check if table exists
+ *
+ *
+ * @param string $table_name The table name to check for
+ * @return bool true if table exists, else false
+ */
+ function sql_table_exists($table_name)
+ {
+ $this->db->sql_return_on_error(true);
+ $result = $this->db->sql_query_limit('SELECT * FROM ' . $table_name, 1);
+ $this->db->sql_return_on_error(false);
+
+ if ($result)
+ {
+ $this->db->sql_freeresult($result);
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
* Create SQL Table
*
* @param string $table_name The table name to create