My client ordered another addition to the script, but I can't figure out how to fix the slowdown? The table has about 50,000 rows.
while($stats = mysql_fetch_array($get_stats)) {
if ($stats['ip'] == gethostbyaddr($stats['ip'])) { // new code
$is_undef = "Yes"; // causing problems
} else { $is_undef = "No"; } // end new code
echo "<tr><td>" . date("d M Y g:i a ", strtotime($stats['date'])) . "</td><td>" .
$stats['ip'] . "</td><td>" .
parse_url_domain($stats['ref_url']) . "</td><td>" .
$is_undef . "</td></tr>";
}
This is the query:
$get_stats = mysql_query("SELECT * FROM visitors WHERE site='$_GET[site]' AND date >= '$start_date' AND date <= '$end_date' ");