I am trying to retrieve a list of referring urls from a MySQL table (column referrer), count urls that appear more than once and list the urls and the count in descending order. I cant work it out!!
$ref=$icdb->get_row("SELECT count(1) AS frequency, referrer FROM url_log WHERE u = '".$dom."'GROUP BY referrer ORDER BY frequency DESC");
foreach ($ref as $details) {
echo $details['referrer']."</td><td>".$details['frequency']."</td>";
}