|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help to query date range from Now to 7 days ago
I am running phpnuke with mysql and I am try to modify a top 15 module that pulls the 15 most read stories. I would like to modify it to only show the most read stories in the last 7 days
Here is the current query PHP Code:
the field Time is setup in this format 2003-09-02 11:40:46 I had tried to add this to the query before order by PHP Code:
I do not get an error when I run, I just get no results. Is Time a reserved word? Do I need quotes around it, and can I use interval with now()? I am a newbie when it comes to Mysql, I am trying to learn though. Any help would be appreciated. |
|
#2
|
|||
|
|||
|
Hi Buddy;
about your Problem in query you simply can user this instead that you wrote in your post : PHP Code:
curdate() return curen date and Date_sub() performs date arecmathic subtract. Last edited by Arash-mikaeili : September 10th, 2003 at 05:08 AM. |
|
#3
|
|||
|
|||
|
Thank you very much I will try it out..
|
|
#4
|
|||
|
|||
|
you are welcome
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > Help to query date range from Now to 7 days ago |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|