note 14420 added to function.ldap-errno.php

From: Date: Mon, 30 Jul 2001 23:16:14 +0000
Subject: note 14420 added to function.ldap-errno.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-16074@lists.php.net to get a copy of this message
Couple of good error codes to get started. If you want to detect failure of ldap_add due to the record already existing, ldap_error == 0x44. This means, you can do something like: $r = ldap_add($ds, $dn, $info); if (!$r) { if (ldap_errno($ds) == 0x44) { // Do something about it } else { // A real failure } } Similarly, on ldap_delete, you will get a 0x20 value (No Such Object) if you try to delete something that isn't there. http://www.php.net/manual/en/function.ldap-errno.php

« previous php.notes (#16074) next »