Updated tables to include other SQL queries in total count

This commit is contained in:
laf
2015-03-27 16:47:26 +00:00
parent 6207bae03a
commit 79ae1acffa
2 changed files with 9 additions and 7 deletions

View File

@@ -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';
}