PHP:Clients head

From distributed.net
Jump to: navigation, search
//

global $dnetClientsDBHostname, $dnetClientsDBUsername, $dnetClientsDBPassword, $dnetClientsDBName;
$db = mysql_pconnect($dnetClientsDBHostname, $dnetClientsDBUsername, $dnetClientsDBPassword);
mysql_select_db($dnetClientsDBName,$db);

$result = mysql_query("select S.description as s_description, S.sectionid, count(*) 
      from sections S, clients C 
      where C.sectionid=S.sectionid and C.visible='true' 
      group by S.description, S.sectionid
      order by S.description asc",$db);

print '<p align="center">';

while ($clientrow = mysql_fetch_array($result)) {
    printf('[<a href="#%s">%s</a>] ',
          $clientrow['sectionid'], 
          str_replace(" ", " ", $clientrow['s_description']) ); 
}

print "</p>";

//