Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Odczyt z tablicy, array();
Deusx
post
Post #1





Grupa: Zarejestrowani
Postów: 126
Pomógł: 2
Dołączył: 27.08.2006

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


  1. $Count = 0;
  2. $a = 0;
  3. $aUzyteIp = array();
  4. $aNazwa = array();
  5. echo '<center><br><br><table width=400><tr><td class=c colspan=3>Multi konta</td></tr>';
  6. while ( $TheUser = mysql_fetch_array($Last15Mins) ) {
  7.  
  8.  
  9. if (in_array($TheUser['user_lastip'],$aUzyteIp)) {
  10. $status = doquery("SELECT `status` FROM {{table}} WHERE `username` ='".$TheUser['username']."' OR `nick1` ='".$TheUser['username']."'","zglos",true);
  11. if($status['status'] == 0) {
  12. echo '<tr><th>Multi </th>','<th>', $TheUser['user_lastip'] ,'</th><th> ', $TheUser['username'], '</th><th>',$aNazwa[$a] , '</th></tr>' ;//$aNazwa[$a] ma wyswietlic nazwe z tablicy
  13. }
  14. } else {
  15. $aUzyteIp[] = $TheUser['user_lastip'];
  16. $aNazwa[$a] = $TheUser['username']; //tutaj ma zapisac nazwe
  17. }
  18.  
  19.  
  20. $Count++;
  21. $a++;
  22. }
  23. echo '</tr></table>';


Jednak w wyświetlaniu "$aNazwa[$a]" nie ma nic. Bardzo proszę o pomoc, co robię źle?

Ten post edytował Deusx 31.05.2010, 00:34:07
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
tehaha
post
Post #2





Grupa: Zarejestrowani
Postów: 1 748
Pomógł: 388
Dołączył: 21.08.2009
Skąd: Gdynia

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


a sprawdzałeś czy dochodzi do przypisania tej wartości?
  1. <?php
  2. $Count = 0;
  3. $a = 0;
  4. $aUzyteIp = array();
  5. $aNazwa = array();
  6. echo '<center><br><br><table width=400><tr><td class=c colspan=3>Multi konta</td></tr>';
  7. while ( $TheUser = mysql_fetch_array($Last15Mins) ) {
  8.  
  9.  
  10. if (in_array($TheUser['user_lastip'],$aUzyteIp)) {
  11. echo "a";
  12. $status = doquery("SELECT `status` FROM {{table}} WHERE `username` ='".$TheUser['username']."' OR `nick1` ='".$TheUser['username']."'","zglos",true);
  13. if($status['status'] == 0) {
  14. echo '<tr><th>Multi </th>','<th>', $TheUser['user_lastip'] ,'</th><th> ', $TheUser['username'], '</th><th>',$aNazwa[$a] , '</th></tr>' ;//$aNazwa[$a] ma wyswietlic nazwe z tablicy
  15. }
  16. } else {
  17. echo "b";
  18. $aUzyteIp[] = $TheUser['user_lastip'];
  19. $aNazwa[$a] = $TheUser['username']; //tutaj ma zapisac nazwe
  20. }
  21.  
  22.  
  23. $Count++;
  24. $a++;
  25. }
  26. echo '</tr></table>';
  27. ?>
Go to the top of the page
+Quote Post

Posty w temacie


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: 5.10.2025 - 02:37