Home  >  Article  >  php教程  >  PostgreSQL连接数据的方法和操作实例

PostgreSQL连接数据的方法和操作实例

WBOY
WBOYOriginal
2016-05-24 18:30:571261browse

";
echo "";
echo "serial_no";
echo "name";
echo "birthday";
echo "";
for ($i = 0; $i < pg_num_rows($result); $i++) {
    $row = @pg_fetch_row($result) or die("can't fetch row from table.");
    $serial_no = $row[0];
    $name = $row[1];
    $birthday = $row[2];
    echo "";
    echo "$serial_no";
    echo "$name";
    echo "$birthday";
    echo "";
}
echo "";
//实例二[pg_fetch_array]
//echo "";
//echo "";
//echo "";
//echo"";
//echo"";
//echo"";
//
//for($i=0;$i";
//echo"";
//echo"";
//echo"";
//echo"";
//
//}
//echo"
serial_nonamebirthday
$serial_no$name$birthday
"; //增加,删除,修改实例 //$newrow=array("serial_no"=>"1006","name"=>"peter","birthday"=>"1990-07-03","salary"=>"90","bonus"=>"80"); //$reusult=@pg_insert($pg,"employes",$newrow) or die("can't insert data to table.");//开源代码phprm.com //if($reusult) //{ //echo "rechords inserted sucessfully!"; //} // pg_close($pg);


本文地址:

转载随意,但请附上文章地址:-)

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn