You are here

protected function MySQLiSource::query in Backup and Migrate 8.4

Run a db query on this destination's db.

Parameters

$query:

Return value

bool|\mysqli_result

Throws

\Exception

6 calls to MySQLiSource::query()
MySQLiSource::_dumpTableSQLToFile in lib/backup_migrate_core/src/Source/MySQLiSource.php
Get the sql to insert the data for a given table.
MySQLiSource::_fetchAssoc in lib/backup_migrate_core/src/Source/MySQLiSource.php
Return the first result of the query as an associated array.
MySQLiSource::_getTableCreateSQL in lib/backup_migrate_core/src/Source/MySQLiSource.php
Get the sql for the structure of the given table.
MySQLiSource::_getTables in lib/backup_migrate_core/src/Source/MySQLiSource.php
Get a list of tables in the db.
MySQLiSource::_lockTables in lib/backup_migrate_core/src/Source/MySQLiSource.php
Lock the list of given tables in the database.

... See full list

File

lib/backup_migrate_core/src/Source/MySQLiSource.php, line 443

Class

MySQLiSource
Class MySQLiSource.

Namespace

BackupMigrate\Core\Source

Code

protected function query($query) {
  if ($conn = $this
    ->_getConnection()) {
    return $conn
      ->query($query);
  }
  else {
    throw new \Exception('Could not run any queries on the database as a connection could not be established');
  }
}