What I'm trying to do is compare a user-entered date between the dates in the start_date and end_date columns. For example, if the user enters '10/03/2010', I want to be able to detect that the date already exists between the two columns, per row, just so I can detect duplicate entries.
I have this right now:
SELECT * FROM unavailability WHERE start_date >= '". format_date_db($start_date) ."' OR end_date <= '". format_date_db($start_date) ."' AND people_id = '$people_id'
but, I think this is checking all the columns, but not necessarily at the "row" level. Is there a way I can check dates that are between each date in each column per row? Thanks!