位置: 编程技术 - 正文
推荐整理分享PHP:pg_fetch_row()的用法_PostgreSQL函数,希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!
(PHP 4, PHP 5)
pg_fetch_row — 提取一行作为枚举数组
说明 array pg_fetch_row ( resource $result [, int $row ] )pg_fetch_row() 根据指定的 result 资源提取一行数据(记录)作为数组返回。每个得到的列依次存放在数组中,从偏移量 0 开始。
Note: 此函数将 NULL 字段设置为 PHP NULL 值。
参数result
PostgreSQL query result resource, returned by pg_query(), pg_query_params() or pg_execute() (among others).
rowRow number in result to fetch. Rows are numbered from 0 upwards. If omitted or NULL, the next row is fetched.
返回值An array, indexed from 0 upwards, with each value represented as a string. Database NULL values are returned as NULL.
返回的数组和提取的行相一致。如果没有更多行 row 可提取,则返回 FALSE。
更新日志版本 说明 4.1.0 参数 row 成为可选参数。
范例
Example #1 pg_fetch_row() 例子
<?php$conn=pg_pconnect("dbname=publisher");if(!$conn){echo"Anerroroccured.n";exit;}$result=pg_query($conn,"SELECTauthor,emailFROMauthors");if(!$result){echo"Anerroroccured.n";exit;}while($row=pg_fetch_row($result)){echo"Author:$row[0]E-mail:$row[1]";echo"<br/>n";}?> 参见pg_query() - 执行查询 pg_fetch_array() - 提取一行作为数组 pg_fetch_object() - 提取一行作为对象 pg_fetch_result() - 从结果资源中返回值
PHP:pg_fetch_result()的用法_PostgreSQL函数 pg_fetch_result(PHP4=4.2.0,PHP5)pg_fetch_result从结果资源中返回值说明mixedpg_fetch_result(resource$result,int$row,mixed$field)pg_fetch_result()根据由pg_query()返回的result资源返回
PHP:pg_fetch_array()的用法_PostgreSQL函数 pg_fetch_array(PHP4,PHP5)pg_fetch_array提取一行作为数组说明arraypg_fetch_array(resource$result[,int$row[,int$result_type]])pg_fetch_array()返回一个与所提取的行(元组/记录)
PHP:pg_fetch_object()的用法_PostgreSQL函数 pg_fetch_object(PHP4,PHP5)pg_fetch_object提取一行作为对象说明objectpg_fetch_object(resource$result[,int$row[,int$result_type]])pg_fetch_object()返回与所提取行的属性相一致的一
标签: PHP:pg_fetch_row()的用法_PostgreSQL函数
本文链接地址:https://www.jiuchutong.com/biancheng/281496.html 转载请保留说明!友情链接: 武汉网站建设