mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-12-25 06:00:28 +01:00
Delete all target db tables before install
This commit is contained in:
parent
e8c563d152
commit
274fcd23c6
@ -138,6 +138,21 @@
|
||||
mysqli_query($db,"SET SESSION SQL_MODE :=''");
|
||||
//mysqli_real_escape_string($db,$import);
|
||||
|
||||
if($value == '../../database/struktur.sql')
|
||||
{
|
||||
// Clear target DB
|
||||
mysqli_query($db,'SET foreign_key_checks = 0');
|
||||
if ($result = mysqli_query($db,"SHOW TABLES"))
|
||||
{
|
||||
while($row = $result->fetch_array(MYSQLI_NUM))
|
||||
{
|
||||
mysqli_query($db,'DROP TABLE IF EXISTS '.$row[0]);
|
||||
}
|
||||
}
|
||||
mysqli_query($db,'SET foreign_key_checks = 1');
|
||||
}
|
||||
|
||||
|
||||
$import = explode (";\r\n", $import);
|
||||
|
||||
foreach ($import as $imp){
|
||||
|
Loading…
Reference in New Issue
Block a user