Code comment

This commit is contained in:
Laurent Destailleur 2018-07-12 11:15:28 +02:00
parent b203421ac6
commit 872895c0b6

View File

@ -262,13 +262,13 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{ {
$resql = $db->query($sql); $resql = $db->query($sql);
$nbtotalofrecords = $db->num_rows($resql); $nbtotalofrecords = $db->num_rows($resql);
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 if (($page * $limit) > $nbtotalofrecords) // if total of record found is smaller than page * limit, goto and load page 0
{ {
$page = 0; $page = 0;
$offset = 0; $offset = 0;
} }
} }
// if total resultset is smaller than limit, no need to do paging adn restart select with limits. // if total of record found is smaller than limit, no need to do paging and to restart another select with limits set.
if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords)
{ {
$num = $nbtotalofrecords; $num = $nbtotalofrecords;