What I want to ask is how to select from database record and my php code able to sort previous date by date,which is what i want to display in my interface:
Can't you simply use this?
SELECT `date` FROM staff WHERE `date` < NOW() ORDER BY `date`
or (if you need only different dates)
SELECT DISTINCT `date` FROM staff WHERE `date` < NOW() ORDER BY `date`