1 database.inc public DatabaseConnection_mysql::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.

Parameters

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: An array of values to substitute into the query at placeholder markers.

array $options: An array of options on the query.

Return value

DatabaseStatementInterface|DatabaseStatementBase|DatabaseStatementPrefetch: A database query result resource, or NULL if the query was not executed correctly.

Overrides DatabaseConnection::queryRange

File

core/includes/database/mysql/database.inc, line 200
Database interface code for MySQL database servers.

Class

DatabaseConnection_mysql
MySQL database connection driver.

Code

public function queryRange($query, $from, $count, array $args = array(), array $options = array()) {
  return $this->query($query . ' LIMIT ' . (int) $from . ', ' . (int) $count, $args, $options);
}