0

This works:
$result = mysql_query("SELECT * FROM plan WHERE begin BETWEEN '2010-09-01' AND '2010-09-30'") or die(mysql_error());

I need some version of this to work where begin and end are currently timestamped columns in my table:
$result = mysql_query("SELECT * FROM plan WHERE date("Y-m-d") BETWEEN begin AND end") or die(mysql_error());

What's the correct form? I haven't been able to tease it out of the documentation.

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by niche1
0

Try it without the enclosed double quotes in the date parameter. Try:

date('Y-m-d')

You've enclosed double quotes with double quotes - problem. Either escape the inner set with a backslash or use single quotes on one of the pairs.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.