function pg_fetch_all()

in pgsql/pgsql.php [734:962]


function pg_fetch_all(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], default: 'resource')] $result, int $mode = PGSQL_ASSOC) {}

/**
 * Fetches all rows in a particular result column as an array
 * @link https://php.net/manual/en/function.pg-fetch-all-columns.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 $field [optional] <p>
 * Column number, zero-based, to be retrieved from the result resource. Defaults
 * to the first column if not specified.
 * </p>
 * @return array An array with all values in the result column.
 * <p>
 * <b>FALSE</b> is returned if <i>column</i> is larger than the number
 * of columns in the result, or on any other error.
 * </p>
 */
function pg_fetch_all_columns(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], default: 'resource')] $result, int $field = 0): array {}

/**
 * Returns number of affected records (tuples)
 * @link https://php.net/manual/en/function.pg-affected-rows.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>
 * @return int The number of rows affected by the query. If no tuple is
 * affected, it will return 0.
 */
function pg_affected_rows(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], default: 'resource')] $result): int {}

/**
 * Get asynchronous query result
 * @link https://php.net/manual/en/function.pg-get-result.php
 * @param resource $connection <p>
 * PostgreSQL database connection resource.
 * </p>
 * @return resource|false The result resource, or <b>FALSE</b> if no more results are available.
 */
#[LanguageLevelTypeAware(['8.1' => 'PgSql\Result|false'], default: 'resource|false')]
function pg_get_result(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection) {}

/**
 * Set internal row offset in result resource
 * @link https://php.net/manual/en/function.pg-result-seek.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 <p>
 * Row to move the internal offset to in the <i>result</i> resource.
 * Rows are numbered starting from zero.
 * </p>
 * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
 */
function pg_result_seek(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], default: 'resource')] $result, int $row): bool {}

/**
 * Get status of query result
 * @link https://php.net/manual/en/function.pg-result-status.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 $mode [optional] <p>
 * Either <b>PGSQL_STATUS_LONG</b> to return the numeric status
 * of the <i>result</i>, or <b>PGSQL_STATUS_STRING</b>
 * to return the command tag of the <i>result</i>.
 * If not specified, <b>PGSQL_STATUS_LONG</b> is the default.
 * </p>
 * @return string|int Possible return values are <b>PGSQL_EMPTY_QUERY</b>,
 * <b>PGSQL_COMMAND_OK</b>, <b>PGSQL_TUPLES_OK</b>, <b>PGSQL_COPY_OUT</b>,
 * <b>PGSQL_COPY_IN</b>, <b>PGSQL_BAD_RESPONSE</b>, <b>PGSQL_NONFATAL_ERROR</b> and
 * <b>PGSQL_FATAL_ERROR</b> if <b>PGSQL_STATUS_LONG</b> is
 * specified. Otherwise, a string containing the PostgreSQL command tag is returned.
 */
function pg_result_status(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], default: 'resource')] $result, int $mode = PGSQL_STATUS_LONG): string|int {}

/**
 * Free result memory
 * @link https://php.net/manual/en/function.pg-free-result.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>
 * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
 */
function pg_free_result(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], default: 'resource')] $result): bool {}

/**
 * Returns the last row's OID
 * @link https://php.net/manual/en/function.pg-last-oid.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>
 * @return string|int|false A string containing the OID assigned to the most recently inserted
 * row in the specified <i>connection</i>, or <b>FALSE</b> on error or
 * no available OID.
 */
function pg_last_oid(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], default: 'resource')] $result): string|int|false {}

/**
 * Returns the number of rows in a result
 * @link https://php.net/manual/en/function.pg-num-rows.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>
 * @return int The number of rows in the result. On error, -1 is returned.
 */
function pg_num_rows(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], default: 'resource')] $result): int {}

/**
 * Returns the number of fields in a result
 * @link https://php.net/manual/en/function.pg-num-fields.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>
 * @return int The number of fields (columns) in the result. On error, -1 is returned.
 */
function pg_num_fields(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], default: 'resource')] $result): int {}

/**
 * Returns the name of a field
 * @link https://php.net/manual/en/function.pg-field-name.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 $field <p>
 * Field number, starting from 0.
 * </p>
 * @return string|false The field name, or <b>FALSE</b> on error.
 */
function pg_field_name(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], default: 'resource')] $result, int $field): string {}

/**
 * Returns the field number of the named field
 * @link https://php.net/manual/en/function.pg-field-num.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 string $field <p>
 * The name of the field.
 * </p>
 * @return int The field number (numbered from 0), or -1 on error.
 */
function pg_field_num(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], default: 'resource')] $result, string $field): int {}

/**
 * Returns the internal storage size of the named field
 * @link https://php.net/manual/en/function.pg-field-size.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 $field <p>
 * Field number, starting from 0.
 * </p>
 * @return int The internal field storage size (in bytes). -1 indicates a variable
 * length field. <b>FALSE</b> is returned on error.
 */
function pg_field_size(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], default: 'resource')] $result, int $field): int {}

/**
 * Returns the type name for the corresponding field number
 * @link https://php.net/manual/en/function.pg-field-type.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 $field <p>
 * Field number, starting from 0.
 * </p>
 * @return string|false A string containing the base name of the field's type, or <b>FALSE</b>
 * on error.
 */
function pg_field_type(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], default: 'resource')] $result, int $field): string {}

/**
 * Returns the type ID (OID) for the corresponding field number
 * @link https://php.net/manual/en/function.pg-field-type-oid.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 $field <p>
 * Field number, starting from 0.
 * </p>
 * @return string|int The OID of the field's base type. <b>FALSE</b> is returned on error.
 */
function pg_field_type_oid(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], default: 'resource')] $result, int $field): string|int {}

/**
 * Returns the printed length
 * @link https://php.net/manual/en/function.pg-field-prtlen.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
 * @param mixed $field [optional]
 * @return int|false The field printed length, or <b>FALSE</b> on error.
 */
function pg_field_prtlen(
    #[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], default: 'resource')] $result,
    #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $row = 0,
    #[PhpStormStubsElementAvailable(from: '8.0')] $row,
    string|int $field
): int|false {}