typo
[mdref/mdref-pq] / pq / Statement / desc.md
1 # array pq\Statement::desc()
2
3 Describe the parameters of the prepared statement.
4
5 ## Params:
6
7 None.
8
9 ## Returns:
10
11 * array, list of type OIDs of the substitution parameters.
12
13 ## Throws:
14
15 * pq\Exception\InvalidArgumentException
16 * pq\Exception\BadMethodCallException
17 * pq\Exception\RuntimeException
18 * pq\Exception\DomainException
19
20 ## Example:
21
22 <?php
23
24 $connection = new pq\Connection;
25 $types = new pq\Types($connection);
26 $statement = $connection->prepare("st1",
27 "SELECT \$1, \$2", [pq\Types::XML, pq\Types::JSON]);
28 $description = $statement->desc();
29
30 foreach($description as $typeOid) {
31 echo $types[$typeOid]->typname, "\n";
32 }
33
34 ?>
35
36 Yields:
37
38 xml
39 json