[Locked] Really need help trying to log users
I really need help trying to show when members have logged in. This is my second post and and the code that I was given, didn't work and now I can't get anyone to tell me what is wrong with it. Here is the code and error message:
Error message is "Unknown column 'billsmith' in 'where clause'
Here is the code I am using:
mysql_select_db($database_connRegister, $connRegister);
$logged_in_user = "-1";
if(isset($_SESSION['MM_Username'])) {
$logged_in_user=$_SESSION['MM_Username'];
$query_online_now = "UPDATE users SET logged_in='Online', last_login_date=NOW() WHERE user_name=$logged_in_user";
$online_now = mysql_query($query_online_now, $connRegister) or die(mysql_error()); }
$query_not_online_now="UPDATE users SET logged_in='Offline' WHERE last_login_date<NOW() - INTERVAL 60 MINUTE";
$not_online_now=mysql_query($query_not_online_now, $connRegister) or die(mysql_error());
Can someone please tell me why it isn't working?
