How would I go about deleting all records from a MySQL table from before a certain date, where the date column is in DATETIME format?
An example datetime is 2011-09-21 08:21:22.
2011-09-21 08:21:22
DELETE FROM table WHERE date < '2011-09-21 08:21:22';
How do you set a default value for a MySQL Datetime column? In SQL Server it's getdate(). What is the equivalant for MySQL? I'm using MySQL 5.x if that is a factor.
Would you recommend using a datetime or a timestamp field, and why (using MySQL)? I'm working with PHP on the server side.
I have a datetime column in MySQL. How can I convert it to the display as mm/dd/yy H:M (AM/PM) using PHP?