位置: 编程技术 - 正文

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%征收率的应税服务
  • 雇佣临时工发生意外能追房东赔偿吗
  • 股东分红纳入社会保险吗
  • 个税计算方法举例讲解
  • 新会计准则规定资产如何入账
  • 苹果6plus自带软件有哪些
  • windows4月更新
  • 汇兑损益 纳税调整
  • 工程结算如何做账
  • macbookpro安装mysql
  • 债券利息收入征税吗
  • 收到发票后补付什么意思
  • php更新数据
  • vue项目上线教程
  • codeigniter3中文手册
  • PHP:imagecolordeallocate()的用法_GD库图像处理函数
  • 多个php文件整合到一起
  • 大前端最新
  • 融资租入的机器设备属于什么科目
  • 基于VGGNet乳腺超声图像数据集分析
  • php session用法
  • 织梦cms官网
  • distinct用法及搭配
  • 公司活动赠送小礼品
  • 开立一般户需要法人到场吗
  • 公司帮员工全额买社保该怎么入账?
  • 所有者权益和负债的主要区别
  • 汽车维修费可以入账吗
  • 建筑发票开具与土增税扣有什么关系?
  • 研发折旧怎么分类
  • 项目上工人死亡赔偿
  • 普通发票开具红字发票后发票联怎么处理?
  • 国有资产保值增值率
  • 电子承兑汇票是到期日前10天提示承兑吗
  • 处理报废的固定资产账务处理
  • 现金劳务收入会计分录
  • 公交车ic卡网上充值
  • 法人存入公司账户会计分录
  • 五险一金个人和公司缴费比例
  • 验资 银行
  • sql2008没有数据库
  • 按不同要求分类
  • innodb怎么实现
  • windows模拟
  • ubuntu14打开终端
  • windowsxp 32位
  • win7微软账户
  • jquery三种遍历方法
  • javascript编写函数
  • 脸部两旁的骨头
  • JavaScript Array对象详解
  • shell脚本怎么写循环
  • scp命令详解(全)
  • js的异步解决方案有哪些
  • jquery 插件编写
  • python3 tkinter
  • 事业单位录用备案表审核快吗
  • 云南港口城市
  • 怎么看扣税明细
  • 物流公司怎么申请TIR
  • 河南网上报税流程图
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设