Hi Guys,

i was wondering if anyone could tell me the correct way to work out how long a go (in minutes) a user logged in, i have this for the number of weeks ago since they joined:

PHP Code:
     // Get the users details from mysql...//////////////////////////////////////////////
$query_1 "SELECT id,username,login,user_class,about_me,country,avatar,join_date, FORMAT( DATEDIFF( NOW(),join_date)/7 ,0) AS join_date FROM `membership` WHERE `id`='$id'";
$result_1 mysql_query($query_1) or die (mysql_error());
$row mysql_fetch_array($result_1); 
but i'm not sure how to do the next query for minutes since they logged in.

thanks guys