The code I'm using is:

Code:
<?php
 $db = mysql_connect("127.0.0.1","mysqluser","mysqlpass");
 mysql_select_db("ugn_linked");
 $hits = mysql_query("SELECT `url` FROM `hits` GROUP BY `url`");
 echo("UGN linked to: ".mysql_num_rows($hits)." different web site(s).
\n");
 while($hit = mysql_fetch_array($hits)) {
  $url = mysql_query("SELECT * FROM `hits` WHERE `url`='".$hits["url"]."'");
  while($page = mysql_fetch_array($url)) {
   echo("url: ".$page["url"].", was visited by: ".$page["ip"].", at: ".date("h:i.a m/j/Y", $page["time"]).", using: ".$page["browser"]."; they came from: ".$page["referer"].".
\n");
  }
 }
 mysql_close();
?>
_________________________
Donate to UGN Security here.
UGN Security, Back of the Web, Elite Web Gamers & VNC Web Design Owner