DatabaseQuery::execute()

Execute the query with the current database handle

Usage

// basic usage
$pDOStatement = $databaseQuery->execute();

// usage with all arguments
$pDOStatement = $databaseQuery->execute(array $options = []);

Arguments

NameType(s)Description
$options (optional)array
  • throw (bool): Throw exceptions? Default:true
  • maxTries (int): Max times to retry if connection lost during query. Default:3
  • returnQuery (bool): Return PDOStatement query? If false, returns bool result of execute. Default:true

Return value

PDOStatement bool

Exceptions

Method can throw exceptions on error:

  • WireDatabaseQueryException or \PDOException


DatabaseQuery methods and properties

API reference based on ProcessWire core version 3.0.252