You'll have to look at some mysql resources to get a better Idea with working with mysql.
What you could do is delete the entry in mysql each time you update a new entry.
Like blazing_wolf said, include the code after the user has been authenticated successfully.
If you're just writing one IP, you'd better o f just write it to a file.
Use fopen('filename.txt', 'w');
That would clear the file each write...
Reputation Points: 457
Solved Threads: 101
Nearly a Posting Virtuoso
Offline 1,250 posts
since Sep 2005