can any body help me .. its urgent

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

djdon11
Forum Commoner
Posts: 90
Joined: Wed Jun 20, 2007 5:03 pm

can any body help me .. its urgent

Post 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.....
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

DATE().

And use more descriptive titles. Your question is no more urgent than any others.
djdon11
Forum Commoner
Posts: 90
Joined: Wed Jun 20, 2007 5:03 pm

php date..

Post 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...
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Did you even look at the documentation I linked to?
djdon11
Forum Commoner
Posts: 90
Joined: Wed Jun 20, 2007 5:03 pm

php date ..

Post by djdon11 »

HI..

i need to bifercate date with time wich is is database ... & check with my condition whether it is true or not....
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Please read the documentation superdezign linked to.
In exactly what way does it not solve your problem?
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: php date ..

Post 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?
djdon11
Forum Commoner
Posts: 90
Joined: Wed Jun 20, 2007 5:03 pm

php

Post 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'
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

At best, it will find zero records.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

No.

'2007 07 03' != '2007-07-03'
djdon11
Forum Commoner
Posts: 90
Joined: Wed Jun 20, 2007 5:03 pm

php

Post by djdon11 »

still not working :(
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Re: php

Post by feyd »

djdon11 wrote:still not working :(
What's changed?

You have private messages waiting, just so you know.
djdon11
Forum Commoner
Posts: 90
Joined: Wed Jun 20, 2007 5:03 pm

php

Post by djdon11 »

"select * from AEA_history_list where coachee_ID = '$coachee_id' and DATE_FORMAT('date','%Y-%m-%d') = '2007-07-03'"
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

'date' is a string.
`date` is a column.
Post Reply