OpenSwoole\Coroutine\PostgreSQL->reset()

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

Declaration

<?php OpenSwoole\Coroutine\PostgreSQL->reset(): bool

Parameters

Return

Returns true if there were no reset errors and false when there was a problem. Check the error message.


Description

Reset the status of current connection.


Example

<?php

use OpenSwoole\Coroutine\PostgreSQL;

co::run(function()
{
    $pg = new PostgreSQL();

    $conn = $pg->connect("host=127.0.0.1;port=5432;dbname=test;user=postgres;password=***");

    $result = $pg->query('SELECT * FROM test;');
    $arr = $pg->fetchAll($result);
    var_dump($arr);
    var_dump($pg->reset());
    var_dump($pg->status());
});
Last updated on September 1, 2022