Jump to content


Photo

Top 10 in a time interval


  • Please log in to reply
1 reply to this topic

#1 Ozz

Ozz
  • Members
  • Pip
  • Newbie
  • 4 posts

Posted 15 June 2003 - 09:27 PM

I got a mysql table like these. I wrote only necessary fields.

TABLE WEBLOG
post_id | t_stamp |month | year | day | c_hits
3 1034407262 3 2003 15 251
5 1034409443 3 2003 15 | 128
6 1034409985 3 2003 17 | 84
...


t_stamp column as unix date and also there are month,year and day columns.
My aim is to make a page shows top 10 hits on daily, weekly, monthly and

yearly base.
I want to arrange post_ids ascending in order to c_hits in a time interval.
Today\'s most read , this month\'s most read ETC..
I need mysql queries to do these.

Thanks by now
[a href="http://www.limk.com/english/" target="_blank"]Limk.com[/a]

#2 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 19 June 2003 - 03:12 AM

Try this

select * from weblog order by c_hits desc limit 1,10

Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users