0

I wonder if I can do a simple boolean check with mysql. I mean can I do something like

SELECT WHERE DATE(`2013-03-25 01:22:26`) = CURDATE()

to return just true or false?

or a php equivalent of this case would also work, but I want to learn this. Is using mysql for such a goal is unnecessary ?

void
  • 1,876
  • 8
  • 24
  • 30

1 Answers1

2

just remove the WHERE clause and use single quote around date.

SELECT DATE('2013-03-25 01:22:26') = CURDATE()
John Woo
  • 258,903
  • 69
  • 498
  • 492