- fix check for mysql-result in installation (backup of old database part), thx Lantizia

This commit is contained in:
Michael Kaufmann (d00p)
2010-09-26 17:25:48 +00:00
parent 1217483894
commit 9c7142817d

View File

@@ -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)