Hello I'm trying to display the most popular link. The MySQL click column increases by each click on each link.. Here's MySQL Query I'm trying to use:
SELECT link, MAX(clicks) FROM $table GROUP BY clicks DESC LIMIT 0,1
This returns http://www.b-man.dk as the most popular site but it just has 5 clicks but while others have 10-11 clicks and some of them have 0 clicks..
Can you guys help me?
try order by instead of group by
Then it displays this error:
Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause
Can anyone help me with my problem? 🙁
hehe I changed the format of the "clicks" column from VARCHAR to INT and it started to work ... 🙂 Thx for your help..