I have been looking for a little while for a solution to this problem, and haven’t really found an answer that works.
I have a MySql table like this:
URL Domain Clicks
http://www.example1.com/erte.html example1.com 10
http://www.example2.com/xndd.html example2.com 5
http://www.example3.com/4567.html example3.com 4
http://www.example1.com/bcdv.html example1.com 7
http://www.example1.com/098i.html example1.com 17
It shows a URL, the domain that the URL points to, and the number of clicks that were recorded for each of the URLs.
I want to be able to show the most popular domain, using the value I get by adding the number of total clicks for that domain, regardless of which actual URL it was.
So, based on my sample values:
example1.com = 34
example2.com = 5
example3.com = 4
So far the examples I’ve been able to find show how to find the popularity of an item based on how many times it is shown in the database. However, that doesn’t include the “clicks” column like I’m trying to do.
Following the examples I have found so far would get me:
example1.com = 3
example2.com = 1
example3.com = 1
Which isn’t really what I’m looking for.
I’m not sure how to do this in an efficient way, and would appreciate any help that I can get.
try:
That will give you your totals ordered from lowest to highest (in clicks)