1 # pq\Result pq\Cursor::fetch([string $spec = "1"])
3 Fetch rows from the cursor.
8 * Optional string $spec = "1"
13 FETCH and MOVE usually accepts arguments like the following, where `count` is the number of rows:
30 See the [official PostgreSQL documentaion](http://www.postgresql.org/docs/current/static/sql-fetch.html) for details.
34 * pq\Result, the fetched row(s).
38 * pq\Exception\InvalidArgumentException
39 * pq\Exception\BadMethodCallException
40 * pq\Exception\RuntimeException
46 $c = new pq\Connection;
47 $p = new pq\Cursor($c, "mycursor", pq\Cursor::WITH_HOLD,
48 "SELECT * FROM generate_series(0,29) s WHERE (s%2)=0");
50 for ($r = $p->fetch(2); $r->numRows; $p->move(1), $r = $p->fetch(2)) {
51 foreach ($r as $row) {
52 foreach ($row as $col) {