diff --git a/application/core/settingManager.php b/application/core/settingManager.php index d0a8311d..dc53c6f2 100644 --- a/application/core/settingManager.php +++ b/application/core/settingManager.php @@ -186,7 +186,8 @@ class SettingManager { ?, ?, ?, @value := ?, @value - );"; + ) ON DUPLICATE KEY UPDATE + `index` = LAST_INSERT_ID(`index`);"; $settingStatement = $mysqli->prepare($settingQuery); if ($mysqli->error) { trigger_error($mysqli->error); @@ -196,6 +197,7 @@ class SettingManager { $settingStatement->execute(); if ($settingStatement->error) { trigger_error($settingStatement->error); + $settingStatement->close(); return false; } $settingStatement->close();