Documentation

Result
in package
implements Result

FinalYes

Table of Contents

Interfaces

Result
Driver-level statement execution result.

Properties

$result  : Result|resource|null

Methods

__construct()  : mixed
__destruct()  : mixed
columnCount()  : int
Returns the number of columns in the result
fetchAllAssociative()  : array<int, array<string, mixed>>
Returns an array containing all of the result rows represented as associative arrays.
fetchAllNumeric()  : array<int, array<int, mixed>>
Returns an array containing all of the result rows represented as numeric arrays.
fetchAssociative()  : array<string, mixed>|false
Returns the next row of the result as an associative array or FALSE if there are no more rows.
fetchFirstColumn()  : array<int, mixed>
Returns an array containing the values of the first column of the result.
fetchNumeric()  : array<int, mixed>|false
Returns the next row of the result as a numeric array or FALSE if there are no more rows.
fetchOne()  : mixed|false
Returns the first value of the next row of the result or FALSE if there are no more rows.
free()  : void
Discards the non-fetched portion of the result, enabling the originating statement to be executed again.
rowCount()  : int
Returns the number of rows affected by the DELETE, INSERT, or UPDATE statement that produced the result.
fetchAssociativeColumnTypes()  : array<string, string>
fetchNumericColumnTypes()  : array<int, string>
mapAssociativeRow()  : array<string, mixed>
mapNumericRow()  : array<int, mixed>
mapType()  : string|int|float|bool|null

Properties

$result

private Result|resource|null $result

Methods

__construct()

public __construct(Result|resource $result) : mixed
Parameters
$result : Result|resource

__destruct()

public __destruct() : mixed

columnCount()

Returns the number of columns in the result

public columnCount() : int
Return values
int

The number of columns in the result. If the columns cannot be counted, this method must return 0.

fetchAllAssociative()

Returns an array containing all of the result rows represented as associative arrays.

public fetchAllAssociative() : array<int, array<string, mixed>>
Return values
array<int, array<string, mixed>>

fetchAllNumeric()

Returns an array containing all of the result rows represented as numeric arrays.

public fetchAllNumeric() : array<int, array<int, mixed>>
Return values
array<int, array<int, mixed>>

fetchAssociative()

Returns the next row of the result as an associative array or FALSE if there are no more rows.

public fetchAssociative() : array<string, mixed>|false
Return values
array<string, mixed>|false

fetchFirstColumn()

Returns an array containing the values of the first column of the result.

public fetchFirstColumn() : array<int, mixed>
Return values
array<int, mixed>

fetchNumeric()

Returns the next row of the result as a numeric array or FALSE if there are no more rows.

public fetchNumeric() : array<int, mixed>|false
Return values
array<int, mixed>|false

fetchOne()

Returns the first value of the next row of the result or FALSE if there are no more rows.

public fetchOne() : mixed|false
Return values
mixed|false

free()

Discards the non-fetched portion of the result, enabling the originating statement to be executed again.

public free() : void

rowCount()

Returns the number of rows affected by the DELETE, INSERT, or UPDATE statement that produced the result.

public rowCount() : int

If the statement executed a SELECT query or a similar platform-specific SQL (e.g. DESCRIBE, SHOW, etc.), some database drivers may return the number of rows returned by that query. However, this behaviour is not guaranteed for all drivers and should not be relied on in portable applications.

Return values
int

The number of rows.

fetchAssociativeColumnTypes()

private fetchAssociativeColumnTypes() : array<string, string>
Return values
array<string, string>

fetchNumericColumnTypes()

private fetchNumericColumnTypes() : array<int, string>
Return values
array<int, string>

mapAssociativeRow()

private mapAssociativeRow(array<string, string|null> $row, array<string, string> $types) : array<string, mixed>
Parameters
$row : array<string, string|null>
$types : array<string, string>
Return values
array<string, mixed>

mapNumericRow()

private mapNumericRow(array<int, string|null> $row, array<int, string> $types) : array<int, mixed>
Parameters
$row : array<int, string|null>
$types : array<int, string>
Return values
array<int, mixed>

mapType()

private mapType(string $postgresType, string|null $value) : string|int|float|bool|null
Parameters
$postgresType : string
$value : string|null
Return values
string|int|float|bool|null

        
On this page

Search results