Okay, so I’m going to try to insert the $_SERVER['REMOTE_ADDR']; in the users column of the database. So It’s like:
username | 192.168.0.1
I tried using insert, to make it insert into the column and overwrite after each log in, but It just makes a whole new row.
mysql_query("INSERT INTO `users` (`last-login`) VALUES ('$ip')");
So, my question is how do I make it overwrite a brand new IP and insert it in the users last login colum each time they login?
Please help.
You would need to use the UPDATE statement and then update the column. I’m sure there is a username field inside the table? If so.. Something like this:
Hope this helps you