1 # bool pq\Result::bind(mixed $col, mixed &$var)
3 Bind a variable to a result column.
4 See pq\Result::fetchBound().
9 The column name or index to bind to.
11 The variable reference.
19 * pq\Exception\InvalidArgumentException
20 * pq\Exception\BadMethodCallException
27 $connection = new pq\Connection;
29 $result = $connection->exec("SELECT id, name, email FROM accounts WHERE email LIKE '_@%'");
31 $result->bind("id", $id);
32 $result->bind("name", $name);
33 $result->bind("email", $email);
35 while ($result->fetchBound()) {
37 echo "Name: {$name}\n";
38 echo "Mail: {$email}\n\n";
40 } catch (\pq\Exception $e) {
41 echo $e->getMessage(), "\n";