1 # mixed pq\Result::fetchRow([int $fetch_type = pq\Result::$fetchType])
3 Iteratively fetch a row.
7 * Optional int $fetch_type
8 The type the return value should have, see pq\Result::FETCH_* constants, defaults to pq\Result::$fetchType.
12 * array, numerically indexed for pq\Result::FETCH_ARRAY
13 * array, associatively indexed for pq\Result::FETCH_ASSOC
14 * object, stdClass instance for pq\Result::FETCH_OBJECT
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 id, name, email FROM accounts WHERE email LIKE '_@%'");
32 while (list($id, $name, $email) = $result->fetchRow()) {
34 echo "Name: {$name}\n";
35 echo "Mail: {$email}\n\n";
37 } catch (\pq\Exception $e) {
38 echo $e->getMessage(), "\n";