How to write a mysql query for php that look at a date/time

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

Post Reply
User avatar
edawson003
Forum Contributor
Posts: 133
Joined: Thu Aug 20, 2009 6:34 am
Location: Los Angeles, CA - USA

How to write a mysql query for php that look at a date/time

Post by edawson003 »

How can I write a mysql query for php that will look at a date/time store field as just date() without the hours and minutes. The conventional CONVERT() doesn't seem to jive with PHP..unless my syntax is off. Any thoughts?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: How to write a mysql query for php that look at a date/time

Post by requinix »

Tried DATE()?

(Capitalized. Means it's a MySQL function.)
mybikeisgreen
Forum Newbie
Posts: 22
Joined: Thu Oct 01, 2009 6:22 pm

Re: How to write a mysql query for php that look at a date/time

Post by mybikeisgreen »

database questions don't belong in this forum, do they?

Have you tried using

LEFT(`fieldname`, 10)

?
Post Reply