September 2001
Intermediate to advanced
768 pages
32h 45m
English
string odbc_errormsg([resource conn]) Returns an ODBC error code.
Returns:
ODBC error message
Description:
Gets the last error message returned from the ODBC connection identifier. This is the actual error message as opposed to a six-digit code from odbc_error(), and hence is more user-friendly. If a connection identifier is specified, the error relates to that specific connection; otherwise, the last error is returned for any available connection.
Version:
Existing since version 4.0-.5
See also:
odbc_error
Example:
$db = odbc_connect("DSN","user","pass"); $sql = "SELECT ProductName, UnitPrice FROM WrongTable"; if (!$result = @odbc_exec($db, $sql)) { echo "Query error! ODBC error: ", odbc_errormsg(); } else ... |
Read now
Unlock full access