- fix check for mysql-result in installation (backup of old database part), thx Lantizia
This commit is contained in:
@@ -511,16 +511,20 @@ if(isset($_POST['installstep'])
|
|||||||
//first we make a backup of the old DB if it exists
|
//first we make a backup of the old DB if it exists
|
||||||
|
|
||||||
status_message('begin', $lng['install']['backup_old_db']);
|
status_message('begin', $lng['install']['backup_old_db']);
|
||||||
|
$tables_exist = false;
|
||||||
|
|
||||||
$sql = "SHOW TABLES FROM $mysql_database";
|
$sql = "SHOW TABLES FROM $mysql_database";
|
||||||
$result = mysql_query($sql);
|
$result = mysql_query($sql);
|
||||||
|
|
||||||
// check the first row
|
// check the first row
|
||||||
$row = mysql_fetch_row($result);
|
if($result !== false)
|
||||||
|
|
||||||
$tables_exist = false;
|
|
||||||
if(isset($row[0]) && $row[0] != '')
|
|
||||||
{
|
{
|
||||||
$tables_exist = true;
|
$row = mysql_num_rows($result);
|
||||||
|
|
||||||
|
if($row > 0)
|
||||||
|
{
|
||||||
|
$tables_exist = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($tables_exist)
|
if($tables_exist)
|
||||||
|
|||||||
Reference in New Issue
Block a user