void pq\Statement::__construct(pq\Connection $conn, string $name, string $query[, array $types = NULL[, bool $async = FALSE]])

Prepare a new statement. See pq\Connection::prepare().

Params:

Throws:

Example:

<?php

$connection = new pq\Connection;
$statement = new pq\Statement(
    $connection,
    "my_statement",
    "SELECT \$1",
    [pq\Types::INT4]
);

$result = $statement->exec([123]);
$result->fetchCol($col);

echo "Got: $col\n";

?>

Yields:

Got: 123