Open Yurunsoft opened 4 years ago
Code:
<?php Co\run(function () { $pg = new Swoole\Coroutine\PostgreSQL(); $conn = $pg->connect("host=127.0.0.1 port=5432 dbname=test user=postgres password=1"); var_dump($conn, $pg->error); $res = $pg->query('select * from tb_user'); \Swoole\Coroutine::sleep(1); // yield var_dump($pg->fetchArray($res), $pg->error); });
Output:
bool(true) NULL bool(false) NULL
Code:
Output: