# Set the info for connecting to mySQL
$dbhost = 'localhost'; # Set the mySQL host name
$dbuser = 'leftquark'; # Set the mySQL username
$dbpasswd = 'n3wd3al'; # Set the mySQL password
$dbname = 'leftquark'; # Set the mySQL database to use
# Attempt to connect to the mySQL database. If it cannot connect, print out the mysql error message.
mysql_connect($dbhost, $dbuser, $dbpasswd) or die("Error connect to db: ". mysql_error());
# Select the mySQL database that contains all the HKN tables
mysql_select_db($dbname);
?>
|
IP |
Hostname |
File |
Downloads |
Last Download |
Uniqname |
$i = 0;
#$getResults = mysql_query("SELECT * FROM nes100_download ORDER BY filename, numDownloads DESC") or die("Error getting data");
$getResults = mysql_query("SELECT * FROM nes100_download ORDER BY lastDownload DESC") or die("Error getting data");
while ($data = mysql_fetch_array($getResults))
{
$ip = $data['ip'];
$hostname = $data['hostname'];
$file = $data['filename'];
$numDownloads = $data['numDownloads'];
$uniqname = $data['uniqname'];
$lastDownload = $data['lastDownload'];
$lastDownload = strtotime($lastDownload);
$lastDownload = date("m/d/Y h:i:s a", $lastDownload);
if ($lastDownload == "11/30/1999 12:00:00 am") $lastDownload = "";
?>
">
echo ($i+1); ?> |
echo $ip; ?> |
echo $hostname; ?> |
echo $file; ?> |
echo $numDownloads; ?> |
echo $lastDownload; ?> |
echo $uniqname; ?> |
$i++;
}
?>
|