refactor: MySQL strict and query fixes (#5338)

* refactor: MySQL strict and query fixes

* moved sql file
This commit is contained in:
Neil Lathwood
2017-01-13 12:47:16 +00:00
committed by Tony Murray
parent 3d0cf76e9b
commit d5296319fb
18 changed files with 70 additions and 43 deletions

View File

@@ -22,7 +22,7 @@ if (!is_numeric($_POST['alert_id'])) {
exit;
} else {
if (dbDelete('alert_rules', '`id` = ?', array($_POST['alert_id']))) {
if (dbDelete('alert_map', 'rule = ?', array($_POST['alert_id'])) || dbFetchCell('COUNT(id) FROM alert_map WHERE rule = ?', array($_POST['alert_id'])) == 0) {
if (dbDelete('alert_map', 'rule = ?', array($_POST['alert_id'])) || dbFetchCell('SELECT COUNT(*) FROM alert_map WHERE rule = ?', array($_POST['alert_id'])) == 0) {
echo 'Maps has been deleted.';
} else {
echo 'WARNING: Maps could not be deleted.';