Page 1 of 2
can any body help me .. its urgent
Posted: Tue Jul 03, 2007 6:07 pm
by djdon11
HI Friends....
i want to know that how we can fetch data from the database table in corresponding to current date of the day..
in the database the field is of datetime type..& there is date is like 2007-07-03 03:30:30.
so i have to fetch data corresponding to date but there is time is also associated with the date then how can i match the date with the database field in select query..
Please help me out for this.....
Posted: Tue Jul 03, 2007 6:13 pm
by superdezign
DATE().
And use more descriptive titles. Your question is no more urgent than any others.
php date..
Posted: Tue Jul 03, 2007 6:15 pm
by djdon11
yes i know the date function ..
but there is time also associated in the table field .. & i hv to match from the date only .. so how can i drop time & only get the date from database...
Posted: Tue Jul 03, 2007 6:21 pm
by superdezign
Did you even look at the documentation I linked to?
php date ..
Posted: Tue Jul 03, 2007 6:52 pm
by djdon11
HI..
i need to bifercate date with time wich is is database ... & check with my condition whether it is true or not....
Posted: Tue Jul 03, 2007 6:56 pm
by feyd
Posted: Tue Jul 03, 2007 6:59 pm
by volka
Please read the documentation superdezign linked to.
In exactly what way does it not solve your problem?
Re: php date ..
Posted: Tue Jul 03, 2007 6:59 pm
by superdezign
djdon11 wrote:HI..
i need to bifercate date with time wich is is database ... & check with my condition whether it is true or not....
... Alzheimer's?
php
Posted: Tue Jul 03, 2007 7:52 pm
by djdon11
is this query is right....
"select * from AEA_history_list where coachee_ID = '$coachee_id' and DATE_FORMAT('date', '%y %m %d') = '2007-07-03'
Posted: Tue Jul 03, 2007 7:53 pm
by feyd
At best, it will find zero records.
Posted: Tue Jul 03, 2007 7:54 pm
by superdezign
No.
'2007 07 03' != '2007-07-03'
php
Posted: Tue Jul 03, 2007 7:59 pm
by djdon11
still not working

Re: php
Posted: Tue Jul 03, 2007 8:01 pm
by feyd
djdon11 wrote:still not working

What's changed?
You have private messages waiting, just so you know.
php
Posted: Tue Jul 03, 2007 8:02 pm
by djdon11
"select * from AEA_history_list where coachee_ID = '$coachee_id' and DATE_FORMAT('date','%Y-%m-%d') = '2007-07-03'"
Posted: Tue Jul 03, 2007 8:07 pm
by superdezign
'date' is a string.
`date` is a column.