this topic sounds a lot like a php topic, not a mysql topic
as far as pulling out users based on their IP, it's conceivable that you'll find IPs with more than one user on them -- corporate offices, university campuses, coffee shop wifi networks, etc.
internet service providers also routinely re-assign IPs, so a different user from the same town could come in with the same IP that someone else used five minutes ago
also, regarding your query (since this is the mysql forum), if you have an IP value, then when you run this --
SELECT u_last_ip FROM user WHERE u_last_ip = '$visitor'
you're going to get back zero, or one, or multiple rows, but each row is going to contain what? just the same value you fed in to the query, but you won't know which user(s) it was!!!