Jump to content

multi help


grlayouts

Recommended Posts

Ok i coded a script and i wan it to check the ips i have in the database for each player, check if there are two the same and report back the name and ip.. what i have is

[code]<?
$title = "Multi Log";
include("header.php");

$get_mm = mysql_query("SELECT * FROM players");
while($row=mysql_fetch_array($get_mm)){
$ip=$row[ip];
$get_mn = mysql_query("SELECT * FROM players WHERE ip='$ip'");
$row2=mysql_fetch_array($get_mn);
if(!empty($row2)) $doubleips[] = $row2[user];
}
print_r($doubleips);


include("footer.php");
?>
[/code]

but it gives me a list instead of just the multi account ones. any ides? the list looks like this.

[code]
Array ( [0] => Admin [1] => murda inc [2] => crazyflip [3] => crazyflip [4] => The Goon [5] => eber [6] => nolan4 [7] => maxpg [8] => xiaoou [9] => laner [10] => lestah [11] => beava [12] => Krazy [13] => kurtis469 [14] => PUCK_ME [15] => Ghost [16] => lstuartreno [17] => bogus103 [18] => SVENG52 [19] => tzayfod [20] => Driftasoarer [21] => jiang [22] => sami270 [23] => briggs80 [24] => hotlude [25] => silent72 [26] => Windowpane [27] => drut86 [28] => 75firebird [29] => Whalen [30] => meredith 91 [31] => One Hit [32] => dietalibanman [33] => TwIsTeD_MaRiNe [34] => freshman91 [35] => freshman91 [36] => 5WoodY5 [37] => mz.murder [38] => mike the VAlint [39] => polsbytch [40] => XMastaCrackaX [41] => ftk420 [42] => rosco [43] => Nicola [44] => freshman91 [45] => lost [46] => chaosthirteen [47] => Abbath [48] => cockatoo [49] => Beanz [50] => foreman [51] => Replikan [52] => Bam~Bam [53] => maka695 [54] => Toon [55] => pussy [56] => jambo [57] => darkrayne [58] => h01377 [59] => CheeseOnToast [60] => Fury [61] => aok [62] => anglegurlstar92 [63] => A33ER [64] => delta0999 [65] => shirubesutsure [66] => josh305 [67] => Zoner [68] => Zorro [69] => bizzybonee99 [70] => ROLLING SQUAD [71] => afonsodomingues [72] => Treven [73] => Russian ppl [74] => trouble [75] => abayahya [76] => bennerhingl [77] => gunne2006 [78] => scarydukey [79] => VikoVeiga [80] => Ayedon [81] => Gruzza [82] => duce [83] => bj977 [84] => 9 Unit's [85] => Zoner [86] => hobomajomo [87] => inturbo [88] => carl4000111 [89] => stedders [90] => billy [91] => island [92] => sweep [93] => mrhobo [94] => mooiiiboyyy [95] => yogie [96] => Shaeed [97] => leatheldave [98] => kovokashi [99] => tno9 [100] => masteroftigerz [101] => Untouchable [102] => warbasherz [103] => nojoegohome [104] => davis [105] => IceCube [106] => Rose [107] => clackfish [108] => steve121 [109] => PiprH [110] => Heavenkiller [111] => Thrice [112] => mikemmax [113] => Connodor [114] => bigdizzle [115] => devilman954 [116] => St.Jimmy [117] => bradleynutty [118] => tygrer [119] => polsbytch [120] => Jager [121] => HobO [122] => treadon [123] => crazyflip [124] => theclowns [125] => hooky [126] => KidA1337 [127] => SBKvenomKWC [128] => yoyak [129] => thedon [130] => jessiesmomie21 [131] => bradleynutty [132] => sinboi [133] => sfkgamer [134] => dmoney [135] => kourrie14 [136] => geiasoy [137] => niklaspiloo1 [138] => splotman [139] => GothicMetal [140] => bradleynutty [141] => marilyn96 [142] => darerevo [143] => mechacourage [144] => kuledude [145] => TrIcKz [146] => Bledsoe [147] => navydawg13 [148] => lady pharaoh [149] => dogsdog [150] => ctoot81 [151] => 2quik4u [152] => TheBoss [153] => Thru [154] => slashsecret [155] => scarface1233 [156] => wildfire79 [157] => dannyboi [158] => tmann456 [159] => rex1227 [160] => hoboleprechaun0 [161] => mickyashy [162] => oggangster [163] => SdotSoldierz8 [164] => ollie2great [165] => Noth [166] => TheGame [167] => banone78 [168] => flossyfarjo [169] => Eternia [170] => masacare [171] => YoungGangsta [172] => scarb [173] => Sparda [174] => Sparda [175] => flossyfarjo [176] => krooneboon [177] => Sparda [178] => evo [179] => dementer06 [180] => dean06 [181] => AlVaRo [182] => king gangsta )

[/code]
Link to comment
https://forums.phpfreaks.com/topic/29312-multi-help/
Share on other sites

Then just do the query I posted and then do another query on those results to disply the individual records. There's probably a way to do this with a single query, but this should work:
[code]<?php
$dups = mysql_query("SELECT ip FROM players GROUP BY ip HAVING COUNT(ip) >1");
while($row=mysql_fetch_array($dups)){
    $records = mysql_query("SELECT user FROM players WHERE ip='$row[ip]'");
    while($row2=mysql_fetch_array($records ) {
        echo $row2['user'] . "<br>";
    }
}
?>[/code]
Link to comment
https://forums.phpfreaks.com/topic/29312-multi-help/#findComment-134394
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.