diff --git a/libraries/classes/Display/Results.php b/libraries/classes/Display/Results.php index 69146b3d05..325314a242 100644 --- a/libraries/classes/Display/Results.php +++ b/libraries/classes/Display/Results.php @@ -4336,7 +4336,10 @@ class Results ); // fetch last row of the result set - $dbi->dataSeek($dt_result, $this->properties['num_rows'] - 1); + $dbi->dataSeek( + $dt_result, + $this->properties['num_rows'] > 0 ? $this->properties['num_rows'] - 1 : 0 + ); $row = $dbi->fetchRow($dt_result); // check for non printable sorted row data @@ -4566,7 +4569,10 @@ class Results } // fetch last row of the result set - $dbi->dataSeek($dt_result, $this->properties['num_rows'] - 1); + $dbi->dataSeek( + $dt_result, + $this->properties['num_rows'] > 0 ? $this->properties['num_rows'] - 1 : 0 + ); $row = $dbi->fetchRow($dt_result); // @see DbiMysqi::fetchRow & DatabaseInterface::fetchRow