位置: 编程技术 - 正文
推荐整理分享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_nameName of the table into which to copy the rows.
rowsAn 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.
delimiterThe token that separates values for each field in each element of rows. Default is TAB.
null_asHow 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
标签: PHP:pg_copy_from()的用法_PostgreSQL函数
本文链接地址:https://www.jiuchutong.com/biancheng/281512.html 转载请保留说明!友情链接: 武汉网站建设