This topic is locked

loading query on page load according to todays date

10/15/2007 3:05:57 PM
PHPRunner General questions
T
theonlyalien author

Hello
I am setting up a diary page in one of my projects but i am unable to load only the current month, or dates that run from today.
can anyone tell me how to load the page to display the query to show the dates from today and also how to do it to include the current month only
thank you
andrew

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=6513&image=1&table=forumtopics' class='bbc_emoticon' alt=':rolleyes:' />

Alexey admin 10/17/2007

Andrew,
add a WHERE clause to your query in Edit SQL query tab in PHPRunner.

I.e.

select

...

from ...

WHERE DateField>=now()

to see dates from current date

or

WHERE month(DateField)=month(now()) and year(DateField)=year(now())



to see current month only.
You can find more info on MySQL functions here:

http://dev.mysql.com/doc/refman/5.0/en/dat...-functions.html

T
theonlyalien author 10/20/2007

hello
thank you
i was a little confused where to put it, it now works exactly as i wanted
thank you again
andrew