I\'m trying to make an last activity function for an website. but i can\'t get it to work. I hope you guys can help me out here.
this is my query:
$last
Your logic is incorrect. Use this:-
"UPDATE users_table SET 'date_last_inlog' = NOW() WHERE user_name = '$user_name'";
You are using this :-
UPDATE users_table SET user_name = '$user_name' WHERE 'date_last_inlog' = NOW()
You are trying to update user_name
column where the date_last_inlog
column value is equal to the current time which is logically incorrect.
Your SQL query is in the wrong order.
$last_activity_query = "UPDATE users_table SET 'date_last_inlog' = NOW() WHERE user_name = '$user_name'";