I have a table which contains a DATETIME column. I wish to include a WHERE clause to limit records based on this column. The format of the constraint is currently 08/23/2012. If need be, I can convert the current format to whatever is needed using PHP.
Should I use PHP to convert the format before passing it to MySQL (and if so, what format should it be), or should I pass it this way, and use MySQL to convert it (and again, how?)
Thanks
You should convert it in PHP:
$date=date( 'Y-m-d H:i:s', strtotime("08/23/2012"))represents the DATETIME format in MySQLCheck the docs: http://dev.mysql.com/doc/refman/5.1/en/datetime.html