How to search for a date
| From: | Brian Dunning | Date: | Thu, 05 Feb 2004 15:45:21 +0000 |
| Subject: | How to search for a date | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-176897@lists.php.net to get a copy of this message | ||
Sorry this is such a basic question - but I couldn't find it online.
I have a date field in MySQL: 0000-00-00. I'm trying to insert or search for the current date, and I can't find the way to state that in the SQL. This is wrong, can someone please tell me what's correct?
INSERT INTO mytable (dateField) VALUE (CURRENT_DATE);
SELECT * FROM mytable WHERE dateField = CURRENT_DATE;
Thanks,
- Brian