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
https://forums.phpfreaks.com/topic/214911-null-value-from-ldap-gives-fatal-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.