The data is passed via $result:
(Taken from the pgsql.php
file that opens (CTRL + Click
on function name in PHPStorm)):
/**
* Fetch a row as an associative array
* @link https://php.net/manual/en/function.pg-fetch-assoc.php
* @param resource $result <p>
* PostgreSQL query result resource, returned by <b>pg_query</b>,
* <b>pg_query_params</b> or <b>pg_execute</b>
* (among others).
* </p>
* @param int $row [optional] <p>
* Row number in result to fetch. Rows are numbered from 0 upwards. If
* omitted or <b>NULL</b>, the next row is fetched.
* </p>
* @return array An array indexed associatively (by field name).
* Each value in the array is represented as a
* string. Database NULL
* values are returned as <b>NULL</b>.
* </p>
* <p>
* <b>FALSE</b> is returned if <i>row</i> exceeds the number
* of rows in the set, there are no more rows, or on any other error.
* @since 4.3
* @since 5.0
*/
function pg_fetch_assoc ($result, $row = null) {}
The rows in $result
is a numbered array/object, containing all data it has. It simply returns the row in that array/object, so it deals with whatever data is in the passed cursor. We can get this from one of the lines from the above code (formatted for better reading):
@param resource $result
PostgreSQL query result resource, returned by
pg_query, pg_query_params or pg_execute