Jump to content

Null value from LDAP gives fatal error


krotovski

Recommended Posts

Hi,

I am trying to search the employeeid value taken from an mssql db against a LDAP database.

It works but when it cannot found the employeeid on the LDAP db it stops with this error:

 

Catchable fatal error: Object of class variant could not be converted to string in ldap2.php on line 101

 

Here is the code.

i've tried with ->value without success :(.

 

Please help me.

 

 

do {$sql = "SELECT EMPL.MATRFROM DOSORDER BY DOS.MATR";$result = mssql_query($sql);while ($myrow = mssql_fetch_array($result)){$matr = $myrow['MATR'];$matr = intval($matr);//echo $matr;$strRS = "Select givenname,sn,displayName,mail,SAMAccountName,employeeid,cn from 'LDAP://dom.local/DC=dom,DC=local' where objectClass='user' and employeeid='$matr'";$RS->Open($strRS, $Conn, 1, 1);echo $RS['cn'];echo "<br>";$RS->Close;}$item++; // iterate count through ldapresults}while ($item < $Result['count']);echo '<hr />';$Conn->Close;

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.