位置: 编程技术 - 正文
推荐整理分享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
PostgreSQL query result resource, returned by pg_query(), pg_query_params() or pg_execute() (among others).
columnColumn 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数据类型的二进制字符串,返回转义
标签: PHP:pg_fetch_all_columns()的用法_PostgreSQL函数
本文链接地址:https://www.jiuchutong.com/biancheng/281502.html 转载请保留说明!友情链接: 武汉网站建设