I'm completely new to Yii and PHP. I have setup Yii and created a new project called MyFirstYii. I'm following the blog demo application to learn the Yii framework.
Now I'm working on the UserIdenty.php file. I want to extend the blog example with an additional field in the User table called lastLogin DATETIME.
And now I'm stuck. The example uses for all datetime fields in the database an integer. I do understand why this is done, it's easy and portable across all databases. But if you want to use external tools on the database, an integer won't be converted to a datetime.
Could someone please give me a coding example how to update the lastLogin field, as a DATETIME field, database independend ? And how should the reverse be coded, retrieving a DATETIME field and converting is to a PHP time ?
The code I have so far is:
class UserIdentity extends CUserIdentity
public function authenticate()
//$currenttime = date( 'Y-m-d H:i:s', time());
Thanks in advance,