★ wanayoo — archive 1999 http://www.php.net/manual/function.ldap-errno.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to LDAP
Quick Reference
German version of this pageJapanese version of this pageItalian version of this pageFrench version of this pageHungarian version of this page
LDAP
* Introduction to LDAP
* ldap_add
* ldap_bind
* ldap_close
* ldap_compare
* ldap_connect
* ldap_count_entries
* ldap_delete
* ldap_dn2ufn
* ldap_err2str
* ldap_errno
* ldap_error
* ldap_explode_dn
* ldap_first_attribute
* ldap_first_entry
* ldap_free_result
* ldap_get_attributes
* ldap_get_dn
* ldap_get_entries
* ldap_get_values
* ldap_get_values_len
* ldap_list
* ldap_modify
* ldap_mod_add
* ldap_mod_del
* ldap_mod_replace
* ldap_next_attribute
* ldap_next_entry
* ldap_read
* ldap_search
* ldap_unbind
Manual: ldap_errno
View the source code for this pageSearch the site



Previous page
 ldap_err2str
 Updated
Sat, 12 Aug 2000
ldap_error 
Next page


ldap_errno

(PHP3 >= 3.0.12, PHP4 >= 4.0RC2)

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

Description

int ldap_errno (int link_id)

return the LDAP error number of the last LDAP command for this link.

This function returns the standardized error number returned by the last LDAP command for the given link identifier. This number can be converted into a textual error message using ldap_err2str().

Unless you lower your warning level in your php3.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) {
    printf("LDAP-Errno: %s<br>\n", ldap_errno($ld));
    printf("LDAP-Error: %s<br>\n", ldap_error($ld));
    die("Argh!<br>\n");
}
$info = ldap_get_entries($ld, $res);
printf("%d matching entries.<br>\n", $info["count"]);
?>

see also ldap_err2str() and ldap_error().


 About Notes


Previous page
 ldap_err2str
 Updated
Sat, 12 Aug 2000
ldap_error 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.