Difference between revisions of "PHP:Clientupdates body"

From distributed.net
Jump to: navigation, search
 
Line 1: Line 1:
 
// <pre>
 
// <pre>
  
$db = mysql_pconnect("localhost", "clientsro", "R3ad0nLy");
+
global $dnetClientsDBHostname, $dnetClientsDBUsername, $dnetClientsDBPassword, $dnetClientsDBName;
mysql_select_db("clients",$db);
+
$db = mysql_pconnect($dnetClientsDBHostname, $dnetClientsDBUsername, $dnetClientsDBPassword);
 
+
mysql_select_db($dnetClientsDBName,$db);
  
 
$result = mysql_query("select S.ranking, S.description as s_description, C.releasedate, C.build, C.description as c_description, C.urlpart, C.instruct, S.sectionid from sections S, clients C where C.sectionid=S.sectionid and C.visible='true' order by C.releasedate Desc, S.ranking Desc, S.description, C.build",$db);
 
$result = mysql_query("select S.ranking, S.description as s_description, C.releasedate, C.build, C.description as c_description, C.urlpart, C.instruct, S.sectionid from sections S, clients C where C.sectionid=S.sectionid and C.visible='true' order by C.releasedate Desc, S.ranking Desc, S.description, C.build",$db);

Latest revision as of 20:48, 9 January 2018

//

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

$result = mysql_query("select S.ranking, S.description as s_description, C.releasedate, C.build, C.description as c_description, C.urlpart, C.instruct, S.sectionid from sections S, clients C where C.sectionid=S.sectionid and C.visible='true' order by C.releasedate Desc, S.ranking Desc, S.description, C.build",$db);


$lastsection = "";

print "<table>";

while ($clientrow = mysql_fetch_array($result))
{
    if ($clientrow['releasedate'] != $lastsection) {
         printf('<tr><td colspan="4"><b>%s</b></td></tr>', $clientrow['releasedate']);
         $lastsection = $clientrow['releasedate'];
     }

     printf("<tr><td> </td>" .
          "<td>%s %s </td>" .
          '<td nowrap="nowrap" align="right"><b>%s</b></td>' .
          "</tr>"
      , $clientrow['s_description'], $clientrow['c_description'], $clientrow['build'] );
}

print "</table>";

//