Column that will write out the current date in the grocery_crud CodeIgniter file

In grocery_crud and Code Igniter in the Employees table I have a column today (dd / mm / yyyy). How to set a column to display the current date. Please help me.

+3


source to share


1 answer


With MySQL, you cannot do this with Date, but with a Timestamp column, and you add the CURRENT_TIMESTAMP value as the default.

As of MySQL 5.6.5 version, you can do it with

CREATE TABLE foo (
    `creation_time`     DATETIME DEFAULT CURRENT_TIMESTAMP,
    `modification_time` DATETIME ON UPDATE CURRENT_TIMESTAMP
)

      



as described here:

fooobar.com/questions/1625 / ...

0


source







All Articles