View Single Post
  #5 (permalink)  
Old 06-09-09, 07:53
techgirl techgirl is offline
BOD Member
 
Join Date: May 2009
Posts: 50
Default

Quote:
Originally Posted by surreality View Post
I take it you want to do something like capture the amount of time a user has stayed logged in? Well, first, like alyaly said, you'll need to make sure your database has the required tables to handle the login/logout date and time info. Then you'll to use PHP to capture the login time and enter it into the database. Something a little like this:

PHP Code:
$login_date date("Y-m-d h:i:s"); 
$sql "UPDATE ".$tbl_name." SET lastLogin='".$login_date()"' WHERE userid=username";
$result mysql_query($sql) or die(mysql_error()); 
You'll have to make changes where necessary, of course, but you get the idea.
Got'cha Surreality. I was thinking along these lines but was still too unsure to give it a try on my own.Thanks for the help.
Reply With Quote