位置: 编程技术 - 正文

PHP:pg_copy_from()的用法_PostgreSQL函数

编辑:rootadmin
pg_copy_from

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

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

(PHP 4 >= 4.2.0, PHP 5)

pg_copy_from — 根据数组将记录插入表中

说明 bool pg_copy_from ( resource $connection , string $table_name , array $rows [, string $delimiter [, string $null_as ]] )

pg_copy_from() 将数组 rows 的内容作为记录插入表中。它在内部使用了 COPY FROM SQL 命令来插入记录。

参数

connection

PostgreSQL database connection resource.

table_name

Name of the table into which to copy the rows.

rows PHP:pg_copy_from()的用法_PostgreSQL函数

An array of data to be copied into table_name. Each value in rows becomes a row in table_name. Each value in rows should be a delimited string of the values to insert into each field. Values should be linefeed terminated.

delimiter

The token that separates values for each field in each element of rows. Default is TAB.

null_as

How SQL NULL values are represented in the rows. Default is N ("N").

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE。

范例

Example #1 pg_copy_from() example

<?php$db=pg_connect("dbname=publisher")ordie("Couldnotconnect");$rows=pg_copy_to($db,$table_name);pg_query($db,"DELETEFROM$table_name");pg_copy_from($db,$table_name,$rows);?>

参见

pg_copy_to() - 将一个表拷贝到数组中

PHP:pg_consume_input()的用法_PostgreSQL函数 pg_consume_input(PHP5=5.6.0)pg_consume_inputReadsinputontheconnection说明boolpg_consume_input(resource$connection)pg_consume_input()consumesanyinputwaitingtobereadfromthedatabaseserver.参数connect

PHP:pg_convert()的用法_PostgreSQL函数 pg_convert(PHP4=4.3.0,PHP5)pg_convert将关联的数组值转换为适合SQL语句的格式。说明arraypg_convert(resource$connection,string$table_name,array$assoc_array[,int$options=0])pg_convert()

PHP:pg_connection_status()的用法_PostgreSQL函数 pg_connection_status(PHP4=4.2.0,PHP5)pg_connection_status获得连接状态说明intpg_connection_status(resource$connection)pg_connection_status()返回一个连接的状态。可能的状态为PGSQL

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

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

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

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

鄂ICP备2023003026号

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

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