public Connection::queryRange($query, $from, $count, array $args = array(), array $options = array())
Runs a limited-range query on this database object.
Use this as a substitute for ->query() when a subset of the query is to be returned. User-supplied arguments to the query should be passed in as separate parameters so that they can be properly escaped to avoid SQL injection attacks.
string $query: A string containing an SQL query.
int $from: The first result row to return.
int $count: The maximum number of result rows to return.
array $args: (optional) An array of values to substitute into the query at placeholder markers.
array $options: (optional) An array of options on the query.
\Drupal\Core\Database\StatementInterface A database query result resource, or NULL if the query was not executed correctly.
Overrides Connection::queryRange
public function queryRange($query, $from, $count, array $args = array(), array $options = array()) { return $this->query($query . ' LIMIT ' . (int) $count . ' OFFSET ' . (int) $from, $args, $options); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Database!Driver!pgsql!Connection.php/function/Connection::queryRange/8.1.x