php+postgresql成功了!

作者:闫少伟  2002-08-02 河南许昌
-----------------------------

建立php文件,内容如下,在浏览器中查看




<?php

$database = pg_connect("host=127.0.0.1 dbname=test user=postgres password=yanswig ");  


    pg_exec ($database, "begin");
    $oid = pg_locreate ($database);
    echo "$oid\n";
    $handle = pg_loopen ($database, $oid, "w");
    echo "$handle\n";
    pg_lowrite ($handle, "large object data");
    pg_loclose ($handle);
    pg_exec ($database, "commit");
    echo "成功了!\n";
?>


------------------------------------------------------
执行结果:
18749 Resource id #3 成功了!

注:由于我的php 4.2.2升级还没有成功,现在的命令是php 4.0.6下面的!