nettrinity
(Thanhvn Info)
1
there is mySQL data type called DATETIME. I am trying this code to generate the time stamp to save into mySQL, but it doesn’t work. Nothing is saved.
$user->created = date("YYYY-MM-DD HH:MM:SS");
Can you tell me who to create the date and time to save into DATETIME data type in MySQL?
Thank you!
elbek
(Elbek Kamoliddinov)
2
use timestamp, do not use date. so in php u can manage by time()
zu3i4ot
(Zu3i4ot)
3
try this, it will work
$user->created = new CDbExpression('now()');