ldap_errno

int ldap_errno(resource connectionID) 

Retrieves the error code for the last LDAP command.

Returns:

Integer

Description:

Returns the standardized integer error code for the last LDAP command used with the given connection ID. To get the textual representation of an error, use ldap_error() or translate it using ldap_err2str(). If no error has occurred, the function will return 0.

Availability:

UNIX/Linux, Windows

Version:

3.0.13+, 4.0RC2+

Example:

Retrieve an error code
$ldapconn = ldap_connect("ldap.foo.com"); 
if (!ldap_bind($ldapconn)) {
    echo "Error number: " ldap_errno($ldapid); 
} 

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.