I was able to accomplish this, but my problem WAS that the wrong row in the MySQL database table was being updated for the user who logged out--the top row for the user (their first log-in record)was being updated, and I wanted to update their bottom row (their last log-in record).
To "fix" this issue, I implemented the following code, WHICH SEEMS TO WORK FINE. Does anyone foresee an issue with my syntax?
$userid = $_SESSION['user_id'];
mysql_query("UPDATE login_timestamps SET id = id, ip = ip, timestamp = timestamp, logout = NOW() WHERE user_id=$userid ORDER BY `id` DESC LIMIT 1");

New Topic/Question
Reply



MultiQuote




|