From 7008bfb5c3b0654d7d25b2e0d0d53d09e4431c0c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 13 May 2009 00:32:19 +0000 Subject: Warn the user if they're attemping to reinstall into a database that already has Gallery 3 tables. Otherwise, permit it to continue. We key this off of the existence of the g3_items table. Theoretically it's possible that the g3_items table is gone but other tables are still there, which could mess things up. I'm not going to worry about that for now. Fixes ticket #175 --- installer/installer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'installer/installer.php') diff --git a/installer/installer.php b/installer/installer.php index 2a8b6219..55ba4c60 100644 --- a/installer/installer.php +++ b/installer/installer.php @@ -76,7 +76,8 @@ class installer { } static function db_empty($config) { - return mysql_num_rows(mysql_query("SHOW TABLES FROM {$config['dbname']}")) == 0; + $query = "SHOW TABLES IN {$config[dbname]} LIKE '{$config[prefix]}items'"; + return mysql_num_rows(mysql_query($query)) == 0; } static function create_admin($config) { -- cgit v1.2.3