Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a "created at" column in a table

I have a form on my website and when somebody fill it the info are copied in my database.

The table is named "form" and its 5 columns:

  • id
  • email
  • phone number
  • country
  • platform

I now need to know when each form entry was submitted, and would like to add a "created at" column which will be filled with the creation time/date timestamp.

Can I retrieve the created date for the row already saved in the table?

like image 548
bjonathan Avatar asked May 06 '11 14:05

bjonathan


1 Answers

Run this script in phpMyAdmin?

ALTER  TABLE Form 
   ADD Column CreatedOn timestamp NOT NULL DEFAULT current_timestamp ;
like image 147
p.campbell Avatar answered Dec 24 '22 15:12

p.campbell