1 # pq\Statement pq\Connection::prepare(string $name, string $query[, array $types = NULL])
3 Prepare a named statement for later execution with pq\Statement::execute().
8 The identifying name of the prepared statement.
11 * Optional array $types = NULL
12 An array of type OIDs for the substitution parameters.
16 * pq\Statement, a prepared statement instance.
20 * pq\Exception\InvalidArgumentException
21 * pq\Exception\BadMethodCallException
22 * pq\Exception\RuntimeException
29 $connection = new pq\Connection;
31 $statement = $connection->prepare(
33 "SELECT a from generate_series(1,9) a WHERE a > \$1",
35 $result = $statement->exec([5]);
37 var_dump($result->fetchAllCols(0));