sandrob57 Posted February 26, 2007 Share Posted February 26, 2007 I have all users ip saved in a database in table "fusion_users" and field "user_ip". I want to make a list that displays all ips, in order of most used (as well as all the field "user_name" for each person that uses it) How would I do this? I can start you off with this: $result1 = dbquery("SELECT user_ip FROM fusion_users WHERE LIMIT $rowstart,20"); Quote Link to comment Share on other sites More sharing options...
btherl Posted February 26, 2007 Share Posted February 26, 2007 Does your table contain one entry for each "usage" of an IP? And do you assume that each ip is only used by one user? Quote Link to comment Share on other sites More sharing options...
sandrob57 Posted February 26, 2007 Author Share Posted February 26, 2007 Does your table contain one entry for each "usage" of an IP? And do you assume that each ip is only used by one user? Each user has a row in the table, and it loges their most recent IP. No, what I am trying to do is catch users with the same IP. Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 26, 2007 Share Posted February 26, 2007 So you don't want people who live in the same household, work together, attend university together to be able to join? Quote Link to comment Share on other sites More sharing options...
btherl Posted February 26, 2007 Share Posted February 26, 2007 Naturally he will be reviewing each case manually, not automatically banning the ip If you're using mysql, you can use SELECT user_ip, group_concat(user_name) as usernames FROM fusion_users GROUP BY user_ip HAVING count(*) > 1 That should give you something like: user_ip usernames 1.2.3.4 btherl,btherlseviltwin Quote Link to comment Share on other sites More sharing options...
sandrob57 Posted February 26, 2007 Author Share Posted February 26, 2007 Naturally he will be reviewing each case manually, not automatically banning the ip If you're using mysql, you can use SELECT user_ip, group_concat(user_name) as usernames FROM fusion_users GROUP BY user_ip HAVING count(*) > 1 That should give you something like: user_ip usernames 1.2.3.4 btherl,btherlseviltwin What would be the variables to spit this out? This is a preview of what I get: http://lunarwars.net/iplist.php When I use the following: $result1 = dbquery(" SELECT user_ip, group_concat(user_name) as usernames FROM fusion_users GROUP BY user_ip HAVING count(*) > 1 LIMIT $rowstart,20"); while ($data = dbarray($result1)) { $cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2"); $i++; $place = $i + $rowstart; echo "\n<td class='$cell_color'>".$data['user_ip']."</td>"; echo "\n<td class='$cell_color'>".$data['user_name']."</td><tr>"; } echo "</table>\n"; Quote Link to comment Share on other sites More sharing options...
btherl Posted February 26, 2007 Share Posted February 26, 2007 Aha, I gave the column a different name. The "group_concat(user_name) AS usernames" means "Name the column usernames". So you would just replace user_name with usernames, and it should work fine Edit: Replace $data['user_name'] with $data['usernames'], I mean. Quote Link to comment Share on other sites More sharing options...
magnetica Posted February 26, 2007 Share Posted February 26, 2007 Can I just say that if your checking IP addresses to see if someone has signed up twice and then block them. This is not a clever way of solving the problem as on one IP there can more than 1 computer (we have 6 computers on one IP). You are going to lose users this way. A better way to do it is check if someone has two or more accounts and then delete them after a period of time if they don't use the account Quote Link to comment Share on other sites More sharing options...
btherl Posted February 26, 2007 Share Posted February 26, 2007 Magnetica, how do you tell if someone has two or more accounts? The system I've used in the past (with mixed success) is to find the users coming from the same ip, and to ask them why they are on the same ip. If they give a good explanation, then I let them be and monitor them for signs of cheating. If no response but they are still logging in, then ban them (and allow them to message me to request unbanning). Quote Link to comment Share on other sites More sharing options...
magnetica Posted February 26, 2007 Share Posted February 26, 2007 Magnetica, how do you tell if someone has two or more accounts? Exactly how you just explained Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 26, 2007 Share Posted February 26, 2007 As long as they're not transferring anything from one account to the other, you don't even really need to ask them. I mean, if it's two people playing and they don't help each other, that's fine, right? If it's one person, and they just want to play so much that they want two seperate accounts, who cares? Quote Link to comment Share on other sites More sharing options...
sandrob57 Posted February 26, 2007 Author Share Posted February 26, 2007 What I'm looking for is suspicious activity between suspicious IP's. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.