In grocery_crud and Code Igniter in table Employees I have column today(dd/mm/yyyy). How to set column to display current date. Please help me.
Asked
Active
Viewed 741 times
3
-
would strtotime() work? (http://php.net/manual/en/function.strtotime.php) – Exploit Apr 11 '13 at 17:55
1 Answers
0
With MySQL you can't do this with a Date but with a Timestamp column, and you add 'CURRENT_TIMESTAMP' as the default value.
That said as of MySQL version 5.6.5 you can do it with :
CREATE TABLE foo (
`creation_time` DATETIME DEFAULT CURRENT_TIMESTAMP,
`modification_time` DATETIME ON UPDATE CURRENT_TIMESTAMP
)
as explained here :

Community
- 1
- 1

Stéphane Bourzeix
- 410
- 2
- 6