合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
# 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); }); ~~~