Fixed SQL bug

This commit is contained in:
f0o
2015-04-04 13:33:19 +00:00
parent 441c27a7d4
commit 1ac5c92280

View File

@ -67,7 +67,7 @@ function GetRules($device) {
$where .= " || alert_map.target = ?";
$params[] = 'g'.$group;
}
return dbFetchRows('SELECT alert_rules.* FROM alert_rules,alert_map WHERE (alert_rules.device_id = -1 || alert_rules.device_id = ? ) || ( alert_rules.id=alert_map.rule && ( alert_map.target = ? '.$where.' ) )',$params);
return dbFetchRows('SELECT alert_rules.* FROM alert_rules LEFT JOIN alert_map ON alert_rules.id=alert_map.rule WHERE (alert_rules.device_id = -1 || alert_rules.device_id = ? ) || ( alert_map.target = ? '.$where.' )',$params);
}
/**