I am trying to get the records from a mysql table where i have two column as start_date and end_date.
i want to display a record when its start date begins, for example if the start date is 10-05-2010 (date, month, year) and if the today date is 10-05-2010, then this record should start displaying until its end_date and stop displaying if end_date gone.
i have used some sql statements which not fulfilled my requirements.
first one:
Expand|Select|Wrap|Line Numbers
- $sqlSelect = "select * from items where start_date >= '$today' and end_date<='$today';
Expand|Select|Wrap|Line Numbers
- $sqlSelect = "select * from items where DATEDIFF(start_date, '$today') <= 0 AND DATEDIFF(end_date, '$today') >= 0 ;
where $today=date("Y-m-d")
im using php to achieve this. please help me. thanx