Fixed entry count on memory page

This commit is contained in:
Mike Rostermund 2015-06-08 13:19:40 +02:00
parent c64345bd5d
commit f1c13d1e3d

View File

@ -12,9 +12,9 @@ if (isset($searchPhrase) && !empty($searchPhrase)) {
$sql .= " AND (`hostname` LIKE '%$searchPhrase%' OR `mempool_descr` LIKE '%$searchPhrase%')"; $sql .= " AND (`hostname` LIKE '%$searchPhrase%' OR `mempool_descr` LIKE '%$searchPhrase%')";
} }
$count_sql = "SELECT COUNT(`mempool_id`) $sql"; $count_sql = "SELECT COUNT(`mempool_id`) $sql";
$total = dbFetchCell($count_sql,$param); $count = dbFetchCell($count_sql,$param);
if (empty($total)) { if (empty($count)) {
$total = 0; $count = 0;
} }
if (!isset($sort) || empty($sort)) { if (!isset($sort) || empty($sort)) {
$sort = '`D`.`hostname`, `M`.`mempool_descr`'; $sort = '`D`.`hostname`, `M`.`mempool_descr`';
@ -68,5 +68,5 @@ foreach (dbFetchRows($sql,$param) as $mempool) {
'mempool_perc' => ''); 'mempool_perc' => '');
} # endif graphs } # endif graphs
} }
$output = array('current'=>$current,'rowCount'=>$rowCount,'rows'=>$response,'total'=>$total); $output = array('current'=>$current,'rowCount'=>$rowCount,'rows'=>$response,'total'=>$count);
echo _json_encode($output); echo _json_encode($output);