💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# Coroutine\\PostgreSQL->prepare 预处理 ~~~ function Coroutine\PostgreSQL->prepare( string $name, string $sql); function Coroutine\PostgreSQL->execute ( string $name, array $bind); ~~~ example: ~~~ go(function () { $pg = new Swoole\Coroutine\PostgreSQL(); $conn = $pg -> connect ("host=127.0.0.1 port=5432 dbname=test user=wuzhenyu password=112"); $pg -> prepare("my_query","select * from test where id > $1 and id < $2"); $res = $pg->execute("my_query", array(1,3)); $arr = $pg -> fetchAll($res); var_dump($arr); }); ~~~