pg_result_status

FunctionParams changed in PHP 8.1

Get status of query result.

PHP 5
PHP 7
PHP 8.0
Improved
PHP 8.1
Improved
PHP 8.2
PHP 8.3
PHP 8.4
PHP 8.5
PHP 8.6

pg_result_status Function synopsis

pg_result_status(PgSql\Result $result, int $mode = PGSQL_STATUS_LONG): string|int

Parameters

$result

TypePgSql\Result

$mode

OptionalTypeintDefault valuePGSQL_STATUS_LONG

Either PGSQL_STATUS_LONG to return the numeric status of the $result, or PGSQL_STATUS_STRING to return the command tag of the $result. If not specified, PGSQL_STATUS_LONG is the default.

Return value

Typestring|int

Possible return values are PGSQL_EMPTY_QUERY, PGSQL_COMMAND_OK, PGSQL_TUPLES_OK, PGSQL_TUPLES_CHUNK, PGSQL_COPY_OUT, PGSQL_COPY_IN, PGSQL_BAD_RESPONSE, PGSQL_NONFATAL_ERROR and PGSQL_FATAL_ERROR if PGSQL_STATUS_LONG is specified. Otherwise, a string containing the PostgreSQL command tag is returned.

Changes to the pg_result_status Function

PHP 8.1

  • Parameter type added for parameter #1 ($result): PgSql\Result
- pg_result_status($result, int $mode = PGSQL_STATUS_LONG): string|int
+ pg_result_status(PgSql\Result $result, int $mode = PGSQL_STATUS_LONG): string|int

PHP 8.0

  • Return type added: string|int
  • Parameter name of parameter #2 changed: $result_type to $mode
  • Parameter type added for parameter #2 ($mode): int
  • Parameter default value added for position #2 ($mode): PGSQL_STATUS_LONG
- pg_result_status($result, $result_type)
+ pg_result_status($result, int $mode = PGSQL_STATUS_LONG): string|int

pg_result_status Function Availability

PHP VersionAvailability
PHP 8.6Future Release Yes
PHP 8.5Upcoming Release Yes
PHP 8.4Supported (Latest) Yes
PHP 8.3Supported Yes
PHP 8.2Security-Fixes Only Yes
PHP 8.1Security-Fixes Only Yes
PHP 8.0Unsupported Yes
PHP 7.4Unsupported Yes
PHP 7.3Unsupported Yes
PHP 7.2Unsupported Yes
PHP 7.1Unsupported Yes
PHP 7.0Unsupported Yes
PHP 5.6Unsupported Yes
PHP 5.5Unsupported Yes
PHP 5.4Unsupported Yes
PHP 5.3Unsupported Yes