Fix limit in SQL query
This commit is contained in:
parent
180a3a52a8
commit
c70082e12d
|
@ -318,6 +318,7 @@ class AuditLog extends HTML
|
||||||
|
|
||||||
$count = (int) db_get_value_sql(sprintf('SELECT COUNT(*) as "total" FROM tsesion WHERE %s', $filter));
|
$count = (int) db_get_value_sql(sprintf('SELECT COUNT(*) as "total" FROM tsesion WHERE %s', $filter));
|
||||||
|
|
||||||
|
if ($length !== '-1') {
|
||||||
$sql = sprintf(
|
$sql = sprintf(
|
||||||
'SELECT *
|
'SELECT *
|
||||||
FROM tsesion
|
FROM tsesion
|
||||||
|
@ -329,6 +330,17 @@ class AuditLog extends HTML
|
||||||
$start,
|
$start,
|
||||||
$length
|
$length
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
$sql = sprintf(
|
||||||
|
'SELECT *
|
||||||
|
FROM tsesion
|
||||||
|
WHERE %s
|
||||||
|
ORDER BY %s',
|
||||||
|
$filter,
|
||||||
|
$order
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$data = db_get_all_rows_sql($sql);
|
$data = db_get_all_rows_sql($sql);
|
||||||
|
|
||||||
if (empty($data) === false) {
|
if (empty($data) === false) {
|
||||||
|
|
Loading…
Reference in New Issue