位置: 编程技术 - 正文

PHP:pg_convert()的用法_PostgreSQL函数

编辑:rootadmin
pg_convert

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

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

(PHP 4 >= 4.3.0, PHP 5)

pg_convert — 将关联的数组值转换为适合 SQL 语句的格式。

说明 array pg_convert ( resource $connection , string $table_name , array $assoc_array [, int $options = 0 ] )

pg_convert() 检查 assoc_array 中的值并将其转换为为适用于 SQL 语句的值。pg_convert() 的前提条件是现有的表 table_name 中具有的列至少有 assoc_array 中的单元那么多。table_name 中的字段名以及字段值必须和 assoc_array 中的键名及值匹配。如果成功则返回一个包括转换后的值的数组,否则返回 FALSE。

Note:

If there are boolean fields in table_name don&#;t use the constant TRUE in assoc_array. It will be converted to the string &#;TRUE&#; which is no valid entry for boolean fields in PostgreSQL. Use one of t, true, 1, y, yes instead.

Warning

此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的PHP 发布版本中未通知就被修改。使用本函数风险自担 。

参数

connection PHP:pg_convert()的用法_PostgreSQL函数

PostgreSQL database connection resource.

table_name

Name of the table against which to convert types.

assoc_array

Data to be converted.

options

Any number of PGSQL_CONV_IGNORE_DEFAULT, PGSQL_CONV_FORCE_NULL or PGSQL_CONV_IGNORE_NOT_NULL, combined.

返回值

An array of converted values, or FALSE on error.

范例

Example #1 pg_convert() example

<?php$dbconn=pg_connect('dbname=foo');$tmp=array('author'=>'JoeThackery','year'=>,'title'=>'MyLife,byJoeThackery');$vals=pg_convert($dbconn,'authors',$tmp);?>

参见

pg_meta_data() - 获得表的元数据

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_client_encoding()的用法_PostgreSQL函数 pg_client_encoding(PHP4=4.0.3,PHP5)pg_client_encoding取得客户端编码方式说明stringpg_client_encoding([resource$connection])pg_client_encoding()以字符串形式返回客户端编码。所

PHP:pg_connection_reset()的用法_PostgreSQL函数 pg_connection_reset(PHP4=4.2.0,PHP5)pg_connection_reset重置连接(再次连接)说明boolpg_connection_reset(resource$connection)pg_connection_reset()重置一个连接,用于错误恢复。

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

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

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

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

鄂ICP备2023003026号

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

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