0

is there any possibility that there is a field called 'time' in the table and there are 3 more fields, and when I insert the 3 fields, the time field is set default to fill in the current UNIX Timestamp? It will be much appreciated if you help me out!

Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43

2 Answers2

0

I just inserted the timestamp from PHP to the table.

0

exactly there is no any default unix_timestamp for mysql. you can set the field as a datetime or timestamp and set its default to CURRENT_TIMESTAMP. then use strtotime function to change back to unix. or set type to int or bigint ordouble and use time() function on every insert row.

I prefer myself to use second way.

Ali Qorbani
  • 1,254
  • 8
  • 27