Войти через VK Войти через FB Войти через Google Войти через Яндекс
Поиск по сайту
$conn = db2_connect('badname', 'baduser', 'badpassword');
if (!$conn) {
print db2_conn_errormsg();
}
Результат выполнения данного примера:
[IBM][CLI Driver] SQL1013N The database alias name
or database name "BADNAME" could not be found. SQLSTATE=42705
SQLCODE=-1013
Смотрите также
- db2_conn_error() - Returns a string containing the SQLSTATE returned by the last connection attempt
- db2_connect() - Returns a connection to a database
- db2_stmt_error() - Returns a string containing the SQLSTATE returned by an SQL statement
- db2_stmt_errormsg() - Returns a string containing the last SQL statement error message

User Contributed Notes 1 note
up
down
0
nnd100216ibmdb2 at smallcue dot com ¶3 years ago
A word of warning:
It appears that if you specify an invalid ibm_db2.instance_name in your php.ini file, your cataloged db2_connect() will fail with a returned value of false and when you use db2_conn_error() or db2_conn_errormsg() to check on the reason, those functions will return an empty string.
