diff --git a/html/ajax_rulesuggest.php b/html/ajax_rulesuggest.php
index 55a1fe108..f5aa0d55c 100644
--- a/html/ajax_rulesuggest.php
+++ b/html/ajax_rulesuggest.php
@@ -56,11 +56,11 @@ function levsort($base, $obj) {
$obj = array(array('name'=>'Error: No suggestions found.'));
$term = array();
+$current == false;
if( isset($_GET['term'],$_GET['device_id']) ) {
$chk = array();
$_GET['term'] = mres($_GET['term']);
$_GET['device_id'] = mres($_GET['device_id']);
- $current == false;
if( strstr($_GET['term'],".") ) {
$term = explode(".",$_GET['term']);
if( $config['memcached']['enable'] ) {
@@ -103,6 +103,7 @@ if( isset($_GET['term'],$_GET['device_id']) ) {
$flds[] = $fld['name'];
}
$qry = dbFetchRows("SELECT ".implode(", ",$flds)." FROM ".$term[0]." WHERE device_id = ?", array($_GET['device_id']));
+ $ret = array();
foreach( $obj as $lev=>$fld ) {
list($tbl, $chk) = explode(".",$fld['name']);
$val = array();
diff --git a/html/includes/print-alert-rules.php b/html/includes/print-alert-rules.php
index 9968ecc98..ed02b801a 100644
--- a/html/includes/print-alert-rules.php
+++ b/html/includes/print-alert-rules.php
@@ -49,6 +49,7 @@ echo('');
$rulei=1;
$count_query = "SELECT COUNT(id)";
$full_query = "SELECT *";
+$sql = '';
$param = array();
if(isset($device['device_id']) && $device['device_id'] > 0) {
$sql = 'WHERE (device_id=? OR device_id="-1")';