💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# Coroutine\PostgreSQL->fetchObject 提取一行作为对象 ```php function Coroutine\PostgreSQL->fetchObject(resource $queryResult [, int $row); ``` example: ```php go(function () { $a = new Swoole\Coroutine\PostgreSQL(); $conn = $a -> connect ("host=127.0.0.1 port=5432 dbname=test user=wuzhenyu"); $result = $a->query('SELECT * FROM test;'); $row = 0; while ($data = $a->fetchObject($result, $row)) { echo $data->id . " \n "; $row++; } }); ``` 或者 ```php go(function () { $a = new Swoole\Coroutine\PostgreSQL(); $conn = $a -> connect ("host=127.0.0.1 port=5432 dbname=test user=wuzhenyu"); $result = $a->query('SELECT * FROM test;'); $row = 0; for ($row = 0 ;$row < $a->numRows($result);$row++){ $data = $a->fetchObject($result, $row); echo $data->id . " \n "; } }); ```