I would have 2 tables. The first is your users table with username, password, etc.
The second would be an "Active Users" table. This would only contain info about users that are currently logged into the system. You would keep the IP in this table.
You could even have a unique constraint on it so that you cannot have 2 users from the same IP. If you try to insert a duplicate IP, the query would fail and you could easily check that.
How do your users timeout? Do you have a cron job that auto logs out your users?
| "Doing a good deed is like wetting your pants; every one can see the results, but only you can feel the warmth."