Jump to content

Timestamp In Php Or Mysql


skaterdav85

Recommended Posts

I have a field called 'time' in one of my tables with a type of 'timestamp' and the default is "Current Timestamp". When I do my mysql_query in php to insert data into the table, do I use the php time function or some kind of mysql reserved word?

Link to comment
Share on other sites

If you want to insert a UNIX timestamp, you would use PHP's time(), however, the MySQL TIMESTAMP data type is the same as DATETIME, and so you would use MySQL's NOW() function if you wanted to insert the current time.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...