i've got a database that inserts records with a time field in the format MM/DD/YYY, instead of a standard timestamp. (bad practice, i know... but unfortunately i didn't write the original code.)
i'm trying to pull the records back out via PHP with a statement like the following, based on a time i'm setting with an earlier form ($criteria_time):
SELECT a, b FROM table WHERE record_time > '$criteria_time'
i've been playing with things like:
$criteria_time = date('n/j/Y', (mktime(0, 0, 0, $month, $day, $year)));
which puts my starting date into a format that matches the one in the database. but i'm having no luck in getting it to work; it just returns every record in the table. can anyone explain how i should be doing this?
i figure i need to tell mySQL to evaluate record_time and criteria_time as dates, but i don't know how to do this. i've tried some permutations of STR_TO_DATE but i keep getting syntax errors. i'm not sure my server's mySQL version is completely up-to-date.
any and all help appreciated.