Skip to content

Capture time stamp on submit

Create a new TIMESTAMP column in the table, and set the default value to CURRENT_TIMESTAMP

Sample code snippet (MySQL)

CREATE TABLE `query` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `date_modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=125 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Feedback and Knowledge Base