diff --git a/html/includes/table/eventlog.inc.php b/html/includes/table/eventlog.inc.php
index 88b33132b..571173803 100644
--- a/html/includes/table/eventlog.inc.php
+++ b/html/includes/table/eventlog.inc.php
@@ -21,13 +21,13 @@ if ($_SESSION['userlevel'] >= '5') {
$param[] = $_SESSION['user_id'];
}
-$count_sql = "SELECT COUNT(datetime) $sql";
-$total = dbFetchCell($count_sql,$param);
-
if (isset($searchPhrase) && !empty($searchPhrase)) {
$sql .= " AND (`D`.`hostname` LIKE '%$searchPhrase%' OR `E`.`datetime` LIKE '%$searchPhrase%' OR `E`.`message` LIKE '%$searchPhrase%' OR `E`.`type` LIKE '%$searchPhrase%')";
}
+$count_sql = "SELECT COUNT(datetime) $sql";
+$total = dbFetchCell($count_sql,$param);
+
if (!isset($sort) || empty($sort)) {
$sort = 'datetime DESC';
}
diff --git a/html/includes/table/poll-log.inc.php b/html/includes/table/poll-log.inc.php
index 53ccaa613..edf7d6ed2 100644
--- a/html/includes/table/poll-log.inc.php
+++ b/html/includes/table/poll-log.inc.php
@@ -1,7 +1,6 @@
" 'graphs', 'group' => 'poller')). "'>" .$device['hostname']. "",
'last_polled' => $device['last_polled'],