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

Declaration

<?php
Swoole\Coroutine\PostgreSQL->fetchAll(resource $queryResult, $resultType = SW_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

  • SW_PGSQL_ASSOC (default): Returns an associative array with the field name as the key index
  • SW_PGSQL_NUM: Return the field number as the key value
  • SW_PGSQL_BOTH: Return to use both as the key value at the same time