Quick bit of example php code to pull people’s details out of the Durham University user database (not LDAP, this is a separate database with slightly different details) – this database is just sitting on the mysql server without a password!
The applications of this database are endless, in this simple example the script grabs everyone from one college and turns it into a handy CSV file you could import into your address book, etc…
Quick example code to dump mildert student data into a csv function fixcase($string){ $words = explode(" ", $string); for($i=0; $i<count($words); $i++)="" {="" $s="strtolower($words[$i]);" strtoupper(substr($s,="" 0,="" 1)),="" 1);="" $result="" .="$s " ;="" }="" $string="trim($result);" return="" $string;="" mysql_connect("mysql.dur.ac.uk",="" "nobody",="" "")="" or="" die(mysql_error());="" $sql="SELECT * FROM UserDetails WHERE (college = 'Van Mildert College' OR department = 'Van Mildert College')" $res="mysql_db_query("Pdcl0www_userdata"," $sql)="" echo="" "first="" name,="" surname,="" display="" email,="" department,="" company,="" website,="" year";="" while($row="mysql_fetch_array($res)){" $name="array();" ",="" str_replace(",",="" "="" ",$row['firstnames']));="" fixcase($name[0]).','.fixcase($row['surname']).','.fixcase($name[0]).'="" '.fixcase($row['surname']).','.$row['email'].','.$row['department'].','.$row['college'].',http:="" www.dur.ac.uk="" vm.jcr="" index.php?option="com_content&task=view&id=48&Itemid=55&person='.$row['username'].','.$row['studyyear']."";" $res;<="" pre=""></count($words);>