I am working on a news portal in which a news (content) will expire after a specific time.The problem is i have to show only one news at one time, i am not sure how to validate it and check that if there is already a news exist of the same duration in database?
Note user can add future (upcoming) news too. Example is below
$newsStartDate = '2017-10-10 14:52:10';
$newsEndDate = '2017-10-11 14:53:10';
I have 2 datetime type column in database (start,expire) now i have to that weather there is already any news exist in the duration of selected $newsStartDate
,$newsEndDate
or not.