Re: date help

From: Date: Sun, 18 Nov 2001 11:07:08 +0000
Subject: Re: date help
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-14422@lists.php.net to get a copy of this message
Hello, You said that you are using MySQL. Create 2 columns like: create_ts INT UNSIGNED NOT NULL, last_login_ts INT UNSIGNED NOT NULL Use the MySQL UNIX_TIMESTAMP() function, comparable to the PHP time() function (number of seconds since 1-1-1970 12:00:00 AM). UPDATE table SET last_login_ts=UNIX_TIMESTAMP() where ID=12345; -Jason Garber IonZoft.com At 02:45 PM 11/17/2001 +0000, Srinivasan Ranganathan wrote:
Hi I need to store the date and time of sign-up and date and time of last successful login in a mysql database and calculate how long the user has been using a site. how do i do this? thanks in advance Srinivasan __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.db (#14422) next »