krotovski Posted October 1, 2010 Share Posted October 1, 2010 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 More sharing options...
krotovski Posted October 1, 2010 Author Share Posted October 1, 2010 Ahhhhhh! Gotcha! if(!$RS->eof()) { echo $RS['cn']; } $RS->Close; Link to comment https://forums.phpfreaks.com/topic/214911-null-value-from-ldap-gives-fatal-error/#findComment-1118083 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.