Location: PHPKode > scripts > AHostLookup > ahostlookup/ahostdisplay.php
// This script displays the number of hits you received from each ISP.
// It reads the database used in ahostlookup class and extracts the
// information for those records with a count greater than zero. It then
// displays the information in a table. 
// ****** edit next two lines to put your own username, password and database_name.

 $db = mysql_connect("localhost","username","password");

<h4>A List of all table entries with a count greater than 0</h4>
<table border="5" bordercolor="000088" cellspacing="0" cellpadding="2">
  <tr bgcolor="#000088">
    <td><font color="#FFFFFF"><b>IDnum</b></font></td>
    <td><font color="#FFFFFF"><b>Host Name</b></font></td>
    <td><font color="#FFFFFF"><b>Zip Code</b></font></td>
    <td><font color="#FFFFFF"><b>Count</b></font></td>
    <td><font color="#FFFFFF"><b>Date</b></font></td>
    <td><font color="#FFFFFF"><b>Time</b></font></td>

 $result = mysql_query("SELECT * FROM isps WHERE count>0 ORDER BY count");
     while ($myrow = mysql_fetch_array($result)) {
     $id = $myrow["id"];
     printf("<tr bgcolor='#bbddee'><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>", $id, $myrow["host"],$myrow["zip"], $myrow["count"], $myrow["date"], $myrow["time"]);
Return current item: AHostLookup