PDO::prepare
PDO::prepare - Prepare the SQL statement to be executed and return a PDOStatement object (PHP 5 >= 5.1.0, PECL pdo >= 0.1.0)
Description
Syntax
public PDOStatement PDO::prepare ( string $statement [, array $driver_options = array() ] )
Prepares the SQL statement to be executed for the PDOStatement::execute() method. The SQL statement can contain zero or more named (:name) or question mark (?) parameter markers, which are replaced when the SQL is executed.
You cannot include both named (:name) and question mark (?) parameter markers in the same SQL statement; you must choose one style.
Parameters in a prepared SQL statement are passed real values when the PDOStatement::execute() method is used.
Parameters
statement
A valid SQL statement.
driver_options
This array contains one or more key=>value pairs to set properties of the PDOStatement object; the most commonly used is setting PDO::ATTR_CURSOR to PDO::CURSOR_SCROLL to request a scrollable cursor.
Return Value
On success, PDO::prepare() returns a PDOStatement object; on failure it returns FALSE or throws a PDOException.
PHP PDO Reference Manual