Skip to content

Commit edbe483

Browse files
author
Marco Cesarato
committed
Added offset option
1 parent af74edf commit edbe483

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# PHP Database Web API
22
![](cover.png)
33

4-
**Version:** 0.6.129 beta
4+
**Version:** 0.6.130 beta
55

66
**Github:** https://github.com/marcocesarato/Database-Web-API
77

includes/classes/API.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ public function parseParams($parts = null) {
132132
'insert' => null,
133133
'update' => null,
134134
'limit' => null,
135+
'offset' => null,
135136
'format' => null,
136137
'callback' => null,
137138
'where' => null,
@@ -767,7 +768,10 @@ private function get($query, $db = null) {
767768

768769
// build LIMIT query
769770
if(!empty($query['limit']) && is_numeric($query['limit'])) {
770-
$sql .= " LIMIT " . (int) $query['limit'];
771+
$sql .= " LIMIT " . intval($query['limit']);
772+
if(!empty($query['offset']) && is_numeric($query['offset'])) {
773+
$sql .= " OFFSET " . intval($query['offset']);
774+
}
771775
}
772776

773777
$sql_compiled = $sql;

0 commit comments

Comments
 (0)