位置: 编程技术 - 正文

PHP:pg_fetch_all_columns()的用法_PostgreSQL函数

编辑:rootadmin
pg_fetch_all_columns

推荐整理分享PHP:pg_fetch_all_columns()的用法_PostgreSQL函数,希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!

(PHP 5 >= 5.1.0)

pg_fetch_all_columns — Fetches all rows in a particular result column as an array

说明 array pg_fetch_all_columns ( resource $result [, int $column = 0 ] )

pg_fetch_all_columns() returns an array that contains all rows (records) in a particular column of the result resource.

Note: 此函数将 NULL 字段设置为 PHP NULL 值。

参数

result PHP:pg_fetch_all_columns()的用法_PostgreSQL函数

PostgreSQL query result resource, returned by pg_query(), pg_query_params() or pg_execute() (among others).

column

Column number, zero-based, to be retrieved from the result resource. Defaults to the first column if not specified.

返回值

An array with all values in the result column.

FALSE is returned if column is larger than the number of columns in the result, or on any other error.

范例

Example #1 pg_fetch_all_columns() example

<?php$conn=pg_pconnect("dbname=publisher");if(!$conn){echo"Anerroroccurred.n";exit;}$result=pg_query($conn,"SELECTtitle,name,addressFROMauthors");if(!$result){echo"Anerroroccurred.n";exit;}//Getanarrayofallauthornames$arr=pg_fetch_all_columns($result,1);var_dump($arr);?>

参见

pg_fetch_all() - 从结果中提取所有行作为一个数组

PHP:pg_execute()的用法_PostgreSQL函数 pg_execute(PHP5=5.1.0)pg_executeSendsarequesttoexecuteapreparedstatementwithgivenparameters,andwaitsfortheresult.说明resourcepg_execute([resource$connection],string$stmtname,array$params)Sendsareque

PHP:pg_delete()的用法_PostgreSQL函数 pg_delete(PHP4=4.3.0,PHP5)pg_delete删除记录说明mixedpg_delete(resource$connection,string$table_name,array$assoc_array[,int$options=PGSQL_DML_EXEC])pg_delete()删除符合条件的记录,条件

PHP:pg_escape_bytea()的用法_PostgreSQL函数 pg_escape_bytea(PHP4=4.2.0,PHP5)pg_escape_bytea转义bytea类型的二进制数据说明stringpg_escape_bytea(string$data)pg_escape_bytea()转义bytea数据类型的二进制字符串,返回转义

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

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

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

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

鄂ICP备2023003026号

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

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