From 9c7142817daf8083e72d42b2dd204d868be47e2b Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Sun, 26 Sep 2010 17:25:48 +0000 Subject: [PATCH] - fix check for mysql-result in installation (backup of old database part), thx Lantizia --- install/install.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/install/install.php b/install/install.php index cc1a3a9c..5b7ae75f 100644 --- a/install/install.php +++ b/install/install.php @@ -511,16 +511,20 @@ if(isset($_POST['installstep']) //first we make a backup of the old DB if it exists status_message('begin', $lng['install']['backup_old_db']); + $tables_exist = false; $sql = "SHOW TABLES FROM $mysql_database"; $result = mysql_query($sql); + // check the first row - $row = mysql_fetch_row($result); - - $tables_exist = false; - if(isset($row[0]) && $row[0] != '') + if($result !== false) { - $tables_exist = true; + $row = mysql_num_rows($result); + + if($row > 0) + { + $tables_exist = true; + } } if($tables_exist)