Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ldap_errno(3) [php man page]

LDAP_ERRNO(3)								 1							     LDAP_ERRNO(3)

ldap_errno - Return the LDAP error number of the last LDAP command

SYNOPSIS
int ldap_errno (resource $link_identifier) DESCRIPTION
Returns the standardized error number returned by the last LDAP command. This number can be converted into a textual error message using ldap_err2str(3). PARAMETERS
o $link_identifier - An LDAP link identifier, returned by ldap_connect(3). RETURN VALUES
Return the LDAP error number of the last LDAP command for this link. EXAMPLES
Unless you lower your warning level in your php.ini sufficiently or prefix your LDAP commands with @ (at) characters to suppress warning output, the errors generated will also show up in your HTML output. Example #1 Generating and catching an error <?php // This example contains an error, which we will catch. $ld = ldap_connect("localhost"); $bind = ldap_bind($ld); // syntax error in filter expression (errno 87), // must be "objectclass=*" to work. $res = @ldap_search($ld, "o=Myorg, c=DE", "objectclass"); if (!$res) { echo "LDAP-Errno: " . ldap_errno($ld) . "<br /> "; echo "LDAP-Error: " . ldap_error($ld) . "<br /> "; die("Argh!<br /> "); } $info = ldap_get_entries($ld, $res); echo $info["count"] . " matching entries.<br /> "; ?> SEE ALSO
ldap_err2str(3), ldap_error(3). PHP Documentation Group LDAP_ERRNO(3)

Check Out this Related Man Page

LDAP_PARSE_RESULT(3)							 1						      LDAP_PARSE_RESULT(3)

ldap_parse_result - Extract information from result

SYNOPSIS
bool ldap_parse_result (resource $link, resource $result, int &$errcode, [string &$matcheddn], [string &$errmsg], [array &$refer- rals]) DESCRIPTION
Parses an LDAP search result. PARAMETERS
o $link - An LDAP link identifier, returned by ldap_connect(3). o $result_identifier - An LDAP result resource, returned by ldap_list(3) or ldap_search(3). o $errcode - A reference to a variable that will be set to the LDAP error code in the result, or 0 if no error occurred. o $matcheddn - A reference to a variable that will be set to a matched DN if one was recognised within the request, otherwise it will be set to NULL. o $errmsg - A reference to a variable that will be set to the LDAP error message in the result, or an empty string if no error occurred. o $referrals - A reference to a variable that will be set to an array set to all of the referral strings in the result, or an empty array if no referrals were returned. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 ldap_parse_result(3) example <?php $result = ldap_search($link, "cn=userref,dc=my-domain,dc=com", "(cn=user*)"); $errcode = $dn = $errmsg = $refs = null; if (ldap_parse_result($link, $result, $errcode, $dn, $errmsg, $refs)) { // do something with $errcode, $dn, $errmsg and $refs } ?> PHP Documentation Group LDAP_PARSE_RESULT(3)
Man Page