love love - 9 days ago 4
MySQL Question

mysql query problem

id url start end
1 http://yahoo.com 2010-10-17 2010-10-10
2 http://google.com 2010-10-15 2010-12-11
3 http://espan.com 2010-10-20 2011-01-20
4 http://espan.com 2010-10-01 2011-01-01


if Today is
2010-10-16
..

how can I get results work in today.

2 http://google.com 2010-10-15 2010-12-11
4 http://espan.com 2010-10-01 2011-01-01

Answer
SELECT id, url, start, end
FROM Your_Table
WHERE 2010-10-16 BETWEEN start AND end

Replace 2010-10-16 with CURRENT_TIMESTAMP or equivalent in MySQL

Comments