View Single Post
  #3 (permalink)  
Old 06-08-09, 12:19
surreality surreality is offline
BOD Member
 
Join Date: Jun 2009
Posts: 50
Default

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.
Reply With Quote