Fix limit in SQL query
This commit is contained in:
parent
180a3a52a8
commit
c70082e12d
|
@ -318,17 +318,29 @@ 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));
|
||||||
|
|
||||||
$sql = sprintf(
|
if ($length !== '-1') {
|
||||||
'SELECT *
|
$sql = sprintf(
|
||||||
FROM tsesion
|
'SELECT *
|
||||||
WHERE %s
|
FROM tsesion
|
||||||
ORDER BY %s
|
WHERE %s
|
||||||
LIMIT %d, %d',
|
ORDER BY %s
|
||||||
$filter,
|
LIMIT %d, %d',
|
||||||
$order,
|
$filter,
|
||||||
$start,
|
$order,
|
||||||
$length
|
$start,
|
||||||
);
|
$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