Is it possible to query against the ldap server stored in drupal without reconnecting? I have a drupal install that uses LDAP to authenticate users.  I use that same LDAP to return user info such as roles, employee photo, email, role, and the center they work at.  

    $ds=ldap_connect("ldap-example.com");  
            if ($ds) { 
                $r=ldap_bind($ds);     
                $sr=ldap_search($ds, "DC=tpcontact,DC=co,DC=uk",$search);  
                $info = ldap_get_entries($ds, $sr)or die('get info fail');
}


I need to make it so that the server is pulled from drupal.  So, if it is possible to query ldap without reconnecting, I need to do that.  Otherwise I need to query the drupal DB's ldap_servers table, the only problem is that I dont have access to a MySql database that has LDAP enabled to see what the field is.
So I assume that you are using the LDAP module?

I've not looked into the code they use however I would expect that they will close the connection before your module runs, and even if they don't the connection won't be a global variable so your module will not have access to it.

If you are writing a custom module then you do have access to the DB - just use db_query and fetch the results, or look in your settings file for your connection details. Then you can connect directly to your DB using software like Navicat.

The table ldap_servers has a field called address. This is where you will find the address to your ldap server.