1 backup.mysql.inc protected BackupMySql::query($query, array $args = array(), array $options = array(), $from = NULL, $count = NULL)

Run a query on this destination's database using Backdrop's MySQL engine.

Parameters

string $query: The query string.

array $args: Arguments for the query.

array $options: Options to pass to the query.

int|null $from: The starting point for the query; when passed will perform a queryRange() method instead of a regular query().

int|null $count: The number of records to obtain from this query. Will be ignored if the $from argument is empty.

See also

DatabaseConnection_mysql::query()

DatabaseConnection_mysql::queryRange()

File

core/includes/backup/backup.mysql.inc, line 423
Contains the BackupMySQL class.

Class

BackupMySql
Creates and restores backups from a MySQL database source.

Code

protected function query($query, array $args = array(), array $options = array(), $from = NULL, $count = NULL) {
  if ($connection = $this->getDatabaseConnection()) {
    // If no $from is passed in, just do a basic query.
    if (is_null($from)) {
      return $connection->query($query, $args, $options);
    }
    // The $from variable was passed in, so do a ranged query.
    else {
      return $connection->queryRange($query, $from, $count, $args, $options);
    }
  }

  return NULL;
}