PHP:Clients head

From distributed.net
Revision as of 22:25, 4 February 2020 by Bovine (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

//


global $dnetClientsDBHostname, $dnetClientsDBUsername, $dnetClientsDBPassword, $dnetClientsDBName;
$db = new mysqli($dnetClientsDBHostname, $dnetClientsDBUsername, $dnetClientsDBPassword, $dnetClientsDBName);

$result = $db->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");

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

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

print "</p>";

//