php db2_connect,db2_conn_error - PHP 5 中文文档

(no version information, might be only in CVS)

db2_conn_error–

Returns a string containing the SQLSTATE returned by the last connection attempt

说明

string db2_conn_error

( [resource connection] )

警告

本函数是实验性

的。本函数的行为,包括函数名称以及其它任何关于本函数的文档可能会在没有通知的情况下随

PHP 以后的发布而改变。使用本函数风险自担。

db2_conn_error()

returns an SQLSTATE value representing

the reason the last attempt to connect to a database failed. As

db2_connect()

returns FALSE

in the event of a failed

connection attempt, you do not pass any parameters to

db2_conn_error()

to retrieve the SQLSTATE value.

If, however, the connection was successful but becomes invalid over time,

you can pass the connection

parameter to retrieve

the SQLSTATE value for a specific connection.

To learn what the SQLSTATE value means, you can issue the following command

at a DB2 Command Line Processor prompt:

db2 ‘? sqlstate-value

. You

can also call db2_conn_errormsg()

to retrieve an

explicit error message and the associated SQLCODE value.

参数

connection

A connection resource associated with a connection that initially

succeeded, but which over time became invalid.

返回值

Returns the SQLSTATE value resulting from a failed connection attempt.

Returns an empty string if there is no error associated with the last

connection attempt.

例子 1. Retrieving an SQLSTATE value for a failed connection attempt

The following example demonstrates how to return an SQLSTATE value

after deliberately passing invalid parameters to

db2_connect()

.

上例将输出:

SQLSTATE value: 08001

参见

db2_conn_errormsg()

db2_connect()

db2_stmt_error()

db2_stmt_errormsg()

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值