位置: 编程技术 - 正文

PHP:pg_fetch_row()的用法_PostgreSQL函数

编辑:rootadmin
pg_fetch_row

推荐整理分享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).

row PHP:pg_fetch_row()的用法_PostgreSQL函数

Row 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()返回与所提取行的属性相一致的一

本文链接地址:https://www.jiuchutong.com/biancheng/281496.html 转载请保留说明!

上一篇:PHP:pg_field_is_null()的用法_PostgreSQL函数

下一篇:PHP:pg_fetch_result()的用法_PostgreSQL函数

免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

鄂ICP备2023003026号

网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

友情链接: 武汉网站建设 电脑维修 湖南楚通运网络