You are here

public function backup_migrate_source_db_mysql::query in Backup and Migrate 7.3

Same name and namespace in other branches
  1. 8.3 includes/sources.db.mysql.inc \backup_migrate_source_db_mysql::query()

Run a query on this source's database using Drupal'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()

5 calls to backup_migrate_source_db_mysql::query()
backup_migrate_source_db_mysql::_dump_table_data_sql_to_file in includes/sources.db.mysql.inc
Get the sql to insert the data for a given table.
backup_migrate_source_db_mysql::_get_table_structure_sql in includes/sources.db.mysql.inc
Get the sql for the structure of the given table.
backup_migrate_source_db_mysql::_get_view_create_sql in includes/sources.db.mysql.inc
Get the sql for the structure of the given view.
backup_migrate_source_db_mysql::_lock_tables in includes/sources.db.mysql.inc
Lock the list of given tables in the database.
backup_migrate_source_db_mysql::_unlock_tables in includes/sources.db.mysql.inc
Unlock all tables in the database.

File

includes/sources.db.mysql.inc, line 521
Functions to handle the direct to database source.

Class

backup_migrate_source_db_mysql
A source type for backing up from database server.

Code

public function query($query, array $args = array(), array $options = array(), $from = NULL, $count = NULL) {
  if ($conn = $this
    ->_get_db_connection()) {

    // If no $from is passed in, just do a basic query.
    if (is_null($from)) {
      return $conn
        ->query($query, $args, $options);
    }
    else {
      return $conn
        ->queryRange($query, $from, $count, $args, $options);
    }
  }
}