位置: 编程技术 - 正文

PHP:pg_result_error_field()的用法_PostgreSQL函数

编辑:rootadmin
pg_result_error_field

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

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

(PHP 5 >= 5.1.0)

pg_result_error_field — Returns an individual field of an error report.

说明 string pg_result_error_field ( resource $result , int $fieldcode )

pg_result_error_field() returns one of the detailed error message fields associated with result resource. It is only available against a PostgreSQL 7.4 or above server. The error field is specified by the fieldcode.

Because pg_query() and pg_query_params() return FALSE if the query fails, you must use pg_send_query() and pg_get_result() to get the result handle.

If you need to get additional error information from failed pg_query() queries, use pg_set_error_verbosity() and pg_last_error() and then parse the result.

参数 PHP:pg_result_error_field()的用法_PostgreSQL函数

result

A PostgreSQL query result resource from a previously executed statement.

fieldcode

Possible fieldcode values are: PGSQL_DIAG_SEVERITY, PGSQL_DIAG_SQLSTATE, PGSQL_DIAG_MESSAGE_PRIMARY, PGSQL_DIAG_MESSAGE_DETAIL, PGSQL_DIAG_MESSAGE_HINT, PGSQL_DIAG_STATEMENT_POSITION, PGSQL_DIAG_INTERNAL_POSITION (PostgreSQL 8.0+ only), PGSQL_DIAG_INTERNAL_QUERY (PostgreSQL 8.0+ only), PGSQL_DIAG_CONTEXT, PGSQL_DIAG_SOURCE_FILE, PGSQL_DIAG_SOURCE_LINE or PGSQL_DIAG_SOURCE_FUNCTION.

返回值

A string containing the contents of the error field, NULL if the field does not exist or FALSE on failure.

范例

Example #1 pg_result_error_field() example

<?php$dbconn=pg_connect("dbname=publisher")ordie("Couldnotconnect");if(!pg_connection_busy($dbconn)){pg_send_query($dbconn,"select*fromdoesnotexist;");}$res1=pg_get_result($dbconn);echopg_result_error_field($res1,PGSQL_DIAG_SQLSTATE);?>

参见

pg_result_error() - 获得查询结果的错误信息

PHP:pg_query()的用法_PostgreSQL函数 pg_query(PHP4=4.2.0,PHP5)pg_query执行查询说明resourcepg_query(resource$connection,string$query)pg_query()在查询可以执行时返回查询结果资源号。如果查询失败或者提供的

PHP:pg_query_params()的用法_PostgreSQL函数 pg_query_params(PHP5=5.1.0)pg_query_paramsSubmitsacommandtotheserverandwaitsfortheresult,withtheabilitytopassparametersseparatelyfromtheSQLcommandtext.说明resourcepg_query_params([resource$connectio

PHP:pg_put_line()的用法_PostgreSQL函数 pg_put_line(PHP4=4.0.3,PHP5)pg_put_line向PostgreSQL后端发送以NULL结尾的字符串说明boolpg_put_line([resource$connection],string$data)pg_put_line()向PostgreSQL后端服务器发送以NULL

标签: PHP:pg_result_error_field()的用法_PostgreSQL函数

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

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

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

  • 主营业务成本借方表示什么意思
  • 业务提成模版
  • 持有待售流动资产如果说以历史成本计量的时候怎么弄
  • 集团内部公司之间怎么称呼
  • 利润和营收哪个更重要
  • 销售使用过的固定资产3%减按2%
  • 电汇凭证如何使用
  • 对公付款没有发票
  • 互联网企业资产负债表特征
  • 发票一定要房东开的才能报销吗?
  • 购车合同起什么作用
  • 企业净资产指的是什么?
  • 分配利润账务处理
  • 工商注册需要提供什么
  • 支票票号都是第二行吗
  • 经营租赁中出租人发生的初始直接费用是指
  • 坏账准备递延所得税资产,不缴所得税
  • 暂估入账冲回
  • 厂房维修是否可以退税
  • 帮公司垫付的钱怎么要
  • php gethostname
  • 出售报废的边角料收入会计分录
  • conda不是内部或外部命令
  • bass boost system
  • thinkphp i方法
  • 住房房产税如何征收
  • 详解php实现执行任务
  • 电子承兑汇票支付流程
  • 业务招待费计入什么会计科目
  • javascript零基础入门书籍
  • 年报企业所得税的分录怎么做
  • 十年磨一剑的下一句幽默
  • 如何查询以前申请的新西兰签证记录
  • 如何在税控盘上申领发票
  • 其他综合收益相关分录
  • 企业补缴税款如何申报
  • 工商年报纳税总额包括个人所得税吗
  • 会计一般什么时候忙
  • 少数股东权益贷方表示什么意思
  • 售后回租服务费开票
  • 对外担保的效力
  • 小规模纳税人购进商品会计分录
  • 申报财产租赁合同怎么写
  • 购买农产品进行销售要交税吗
  • 总分包模式和总承包模式
  • 如何对企业进行有效的控制
  • 房产税什么时候开始征收2023
  • 计税金额是什么科目
  • win10预览版21277
  • ubuntu 桌面
  • 445端口 关闭
  • centos的优缺点
  • 电脑主板bios是什么意思
  • nhaspx.exe是什么
  • windows10更新最新版本
  • centos支持中文
  • windows8为什么不好用
  • win10系统预览版
  • bzip2 bunzip2 bzcat参数使用
  • win10网速特别慢
  • win7回收站图标在哪个文件夹
  • 宏基win8改win7
  • window10光驱不能用了
  • mingw 编译
  • opengl3d
  • extend列表
  • jquery的使用步骤
  • linux shell脚本编程100例
  • linux判断脚本执行成功
  • opengl learn
  • 自动断开网络共享怎么办
  • 小助手是什么软件
  • unity androidx
  • js实现滑动效果
  • 劳动监察执法机构是什么
  • 餐饮服务需要交印花税吗?
  • 增值税消费税申报比对不符怎么办
  • 中国税务社保缴费app下载
  • 江西省抚州市黎川县洵口镇
  • 上海买新房办贷款流程
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设