Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Wyświetlanie userów o tym samym IP
Rochu
post
Post #1





Grupa: Zarejestrowani
Postów: 64
Pomógł: 14
Dołączył: 25.09.2010

Ostrzeżenie: (0%)
-----


Witam. Mam mały problem, gdyż przerabiałem sobie skrypcik wyświetlający userów o tym samym ip, lecz nie mogę sobie z nim poradzić. Dodam iż gdy wyskakuje mi taki błąd:

  1. Parse error: syntax error, unexpected T_FOREACH in /var/www/virtual/XXX/strony/admin/admin_ip_users.php on line 13


A tutaj kod skryptu:

  1. <?php
  2.  
  3. $wynik = mysql_query("SELECT GROUP_CONCAT(gracz) AS gracz, GROUP_CONCAT(login) AS ip_user_name, adres_ip, COUNT(adres_ip) AS num FROM tribal_gracze GROUP BY adres_ip HAVING num > 1");
  4. echo "<table border='0' width='100%' class='small'>";
  5. if(mysql_num_rows($wynik) > 0)
  6. {
  7. $users = '';
  8. while($r = mysql_fetch_array($wynik))
  9. {
  10. $name = explode(",", $r['ip_user_name']);
  11. $id = explode(",", $r['gracz']);
  12. $c = array_combine($id, $name)
  13. foreach ($c as $key => $value)
  14. {
  15. $users .= "<a href='?akcja=profil&gracz=".$key."'>".$value."</a>, ";
  16. }
  17. echo "<tr><td class='small'>* <span style='font-weight: bold;'>".$r['adres_ip']."</span> - Posiada ".number_format($r['num'])." uzytkownikow.</td></tr>";
  18. echo "<tr><td class='small'>".substr($users, 0, -2)."</td></tr>";
  19. $users = '';
  20. }
  21. }
  22. else
  23. {
  24. echo "<tr><td class='small'>Brak uzytkownikow o tym samym ip.</td></tr>";
  25. }
  26. echo "</table>";
  27. ?>


Ten post edytował Rochu 2.10.2010, 12:29:32
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
mhw
post
Post #2





Grupa: Zarejestrowani
Postów: 43
Pomógł: 10
Dołączył: 3.08.2009

Ostrzeżenie: (0%)
-----


Linijkę wcześniej brakuje średnika... (IMG:style_emoticons/default/blinksmiley.gif)
Go to the top of the page
+Quote Post
Rochu
post
Post #3





Grupa: Zarejestrowani
Postów: 64
Pomógł: 14
Dołączył: 25.09.2010

Ostrzeżenie: (0%)
-----


Rzeczywiście (IMG:style_emoticons/default/smile.gif) taki mały, głupi błąd ;D

Dzięki wielkie (IMG:style_emoticons/default/tongue.gif)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.12.2025 - 12:11