OpenSwoole\Coroutine\PostgreSQL->fetchAll(...)

Latest version: pecl install openswoole-22.1.2 | composer require openswoole/core:22.1.5

Declaration

<?php OpenSwoole\Coroutine\PostgreSQL->fetchAll(resource $queryResult, $resultType = OpenSwoole\Constant::PGSQL_ASSOC):? array

Parameters

queryResult

The result of a executed SQL query which will be a PHP resource variable type.

resultType

By default it will return a associative array with the field name as the key index. See the description for other options. This controls how data is returned from the resource.

Return

Returns an array of results.


Description

Fetch all the data from a SQL query result. The type will be a PHP resource.

Return Array Options

  • OpenSwoole\Constant::PGSQL_ASSOC (default): Returns an associative array with the field name as the key index
  • OpenSwoole\Constant::PGSQL_NUM: Return the field number as the key value
  • OpenSwoole\Constant::PGSQL_BOTH: Return to use both as the key value at the same time

Last updated on September 20, 2022