pq/Cursor docs
[mdref/mdref-pq] / pq / Statement / exec.md
1 # pq\Result pq\Statement::exec([array $params = NULL])
2
3 Execute the prepared statement.
4
5 ## Params:
6
7 * Optional array $params = NULL
8 Any parameters to substitute in the preapred statement (defaults to any bou
9 nd variables).
10
11 ## Returns:
12
13 * pq\Result, the result of the execution of the prepared statement.
14
15 ## Throws:
16
17 * pq\Exception\InvalidArgumentException
18 * pq\Exception\BadMethodCallException
19 * pq\Exception\RuntimeException
20
21 ## Example:
22
23 <?php
24
25 $connection = new pq\Connection;
26 $statement = $connection->prepare("st1", "SELECT int4(\$1)");
27 $result = $statement->exec([123]);
28
29 ?>