1 # void pq\Statement::bind(int $param_no, mixed &$param_ref)
3 Bind a variable to an input parameter.
8 The parameter index to bind to.
14 * pq\Exception\InvalidArgumentException
15 * pq\Exception\BadMethodCallException
22 $connection = new pq\Connection;
23 $statement = $connection->prepare("st1",
24 "SELECT \$1 as first, \$2 as second", [pq\Types::INT4, pq\Types::INT4]);
26 $statement->bind(1, $first);
27 $statement->bind(2, $second);
32 $result = $statement->exec();
33 foreach ($result->fetchRow(pq\Result::FETCH_ASSOC) as $col => $val) {
34 printf("%10s = %s\n", $col, $val);