First you need a date/time column called something ingenious like ‘dtInsert’. On your insert statement, append a quick ‘CURDATE()’ for that column, and there you go! Easy fix… assuming you find adding columns to existing tables easy.
This might help
Login to MySQL with a user that has sufficient privileges on your database.
select your database by using
use database-name;
add a column to your table using
ALTER TABLE table-name ADD date_entered timestamp DEFAULT CURRENT_TIMESTAMP;
the current_timestamp default will automatically add the date/time when you add a new comment to your database table - you don’t even need to change your insert statement when a comment is submitted!
to retrieve it in a human-readable manner, in your select statement, use DATE_FORMAT( date_entered, GET_FORMAT(DATE, ‘USA’))
That will return the default US version for date, which is usually good enough. If you want to display the date differently, please look at all the possible ways here:
example:
SELECT comment, DATE_FORMAT( date_entered, GET_FORMAT(DATE, ‘USA’)) FROM table-name;
let me know if you need more help