1 # bool pq\Result::fetchCol(mixed &$ref[, mixed $col = 0])
3 Iteratively fetch a single column.
8 The variable where the column value will be stored in.
9 * Optional mixed $col = 0
10 The column name or index.
15 * NULL, when iteration ends.
19 * pq\Exception\InvalidArgumentException
20 * pq\Exception\BadMethodCallException
21 * pq\Exception\RuntimeException
28 $connection = new pq\Connection;
30 $result = $connection->exec("SELECT email FROM accounts WHERE email LIKE '_@%'");
32 while ($result->fetchCol($email)) {
33 echo "Mail: {$email}\n";
35 } catch (\pq\Exception $e) {
36 echo $e->getMessage(), "\n";