I think that the users are listed twice (or multiple's) because you now also select the location...
When you have 2 sessions from the same user now everything will be the same (session.userid,username,invisible) except for the location...
So DISTINCT doesn't work then, because he 'sees' those 2 records as two different ones because of the locationfield...
There could be a workaround on this...Make an array or something; New record -> userid allready in the array? skip it...otherwise -> add userid to array -> list user
Only troubles would be with guests then...or you can check on the ipaddress if (s)he's allready listed
|