public function backup_migrate_destination_db_mysql::query in Backup and Migrate 7.3
Same name and namespace in other branches
- 8.2 includes/destinations.db.mysql.inc \backup_migrate_destination_db_mysql::query()
- 8.3 includes/destinations.db.mysql.inc \backup_migrate_destination_db_mysql::query()
- 7.2 includes/destinations.db.mysql.inc \backup_migrate_destination_db_mysql::query()
Run a query on this destination'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_destination_db_mysql::query()
- backup_migrate_destination_db_mysql::_dump_table_data_sql_to_file in includes/
destinations.db.mysql.inc - Get the sql to insert the data for a given table.
- backup_migrate_destination_db_mysql::_get_table_structure_sql in includes/
destinations.db.mysql.inc - Get the sql for the structure of the given table.
- backup_migrate_destination_db_mysql::_get_view_create_sql in includes/
destinations.db.mysql.inc - Get the sql for the structure of the given table.
- backup_migrate_destination_db_mysql::_lock_tables in includes/
destinations.db.mysql.inc - Lock the list of given tables in the database.
- backup_migrate_destination_db_mysql::_unlock_tables in includes/
destinations.db.mysql.inc - Unlock all tables in the database.
File
- includes/
destinations.db.mysql.inc, line 529 - Functions to handle the direct to database destination.
Class
- backup_migrate_destination_db_mysql
- A destination type for saving to a 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);
}
}
}