public Connection::prepare($statement, array $driver_options = array())
Prepares a statement for execution and returns a statement object
Emulated prepared statements does not communicate with the database server so this method does not check the statement.
string $statement: This must be a valid SQL statement for the target database server.
array $driver_options: (optional) This array holds one or more key=>value pairs to set attribute values for the PDOStatement object that this method returns. You would most commonly use this to set the \PDO::ATTR_CURSOR value to \PDO::CURSOR_SCROLL to request a scrollable cursor. Some drivers have driver specific options that may be set at prepare-time. Defaults to an empty array.
\PDOStatement|false If the database server successfully prepares the statement, returns a \PDOStatement object. If the database server cannot successfully prepare the statement returns FALSE or emits \PDOException (depending on error handling).
\PDOException
\PDO::prepare()
public function prepare($statement, array $driver_options = array()) { return $this->connection->prepare($statement, $driver_options); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Database!Connection.php/function/Connection::prepare/8.1.x