i have this script that inserts data with a time field with the following format MM/DD/YYY into a mySQL database , instead of a standard timestamp format.
then i try to pull the data back out via PHP with a query like the this, based on a date i get from another form:
SELECT data1, data2 FROM table WHERE record_time > '$date'
i have tried soemthing like this:
$date = date('n/j/Y', (mktime(0, 0, 0, $month, $day, $year)));
which should put my date in a format same as the database. but i'm having no luck in getting it to work, it just returns every record in the table! does anyone know how i should be doing this? i figure i need to tell mySQL to evaluate $date as dates and not just strings, but i don't know how to do this.
Thanks in advance
then i try to pull the data back out via PHP with a query like the this, based on a date i get from another form:
SELECT data1, data2 FROM table WHERE record_time > '$date'
i have tried soemthing like this:
$date = date('n/j/Y', (mktime(0, 0, 0, $month, $day, $year)));
which should put my date in a format same as the database. but i'm having no luck in getting it to work, it just returns every record in the table! does anyone know how i should be doing this? i figure i need to tell mySQL to evaluate $date as dates and not just strings, but i don't know how to do this.
Thanks in advance
