tags:

views:

36

answers:

1

Hello

I have a table : tags(tagname,entryid,stamp) and i want to make a section for the most trending tags today, the tagname column has no unique value, because many entries has the same tag, so the php code that i want should display the most attached tags today.

Note: the "stamp" column is the date of adding the tag in UNIX time stamp format.

Thanks

+2  A: 
SELECT `tagname`, COUNT(*) AS `cnt`
FROM `tags`
WHERE `stamp` >= UNIX_TIMESTAMP(DATE(NOW()))
GROUP BY `tagname`
ORDER BY `cnt` DESC
LIMIT 10
zerkms
Thanks so much :)
David