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; Quote Link to comment 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; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.