fixed error in function check mr

This commit is contained in:
daniel 2017-10-13 14:08:50 +02:00
parent 4d5a129ec4
commit 48e68b1264

View File

@ -1329,12 +1329,14 @@ function db_run_sql_file ($location) {
foreach ($lines as $line) {
$line = trim($line);
if ($line && !preg_match('/^--/', $line) && !preg_match('/^\/\*/', $line)) {
$line = preg_replace('/;$/',"__;__", $line);
$commands .= $line;
}
}
// Convert to array
$commands = explode(";", $commands);
$commands = explode("__;__", $commands);
if ($config['mysqli']) {
$mysqli = new mysqli($config["dbhost"], $config["dbuser"], $config["dbpass"], $config["dbname"], $config["dbport"]);
@ -1350,6 +1352,8 @@ function db_run_sql_file ($location) {
foreach ($commands as $command) {
if (trim($command)) {
$command .= ";";
if ($config['mysqli']) {
$result = $mysqli->query($command);
}