Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [SQL][MySQL][PHP]pomoc
goku131
post 6.09.2013, 15:50:30
Post #1





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 6.09.2013

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


witam wyskakuje mi blad:

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/epixcs/public_html/new/index.php on line 72


http://epix-cs.xaa.pl/new/index.php

co moge zrobić aby działo
Go to the top of the page
+Quote Post
Kshyhoo
post 6.09.2013, 15:55:45
Post #2





Grupa: Opiekunowie
Postów: 3 855
Pomógł: 317
Dołączył: 4.01.2005
Skąd: że




Brak średnika.


--------------------
Go to the top of the page
+Quote Post
goku131
post 6.09.2013, 15:57:02
Post #3





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 6.09.2013

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


  1. <?
  2. mysql_connect('localhost','epixcs_css','DzM%~z)875.S') or die('Blad poƒaczenia');
  3. mysql_select_db('epixcs_przemo') or die('Blad polaczenia z baza');
  4.  
  5. ?>

tu mam kod

mozna jasniej/?
Go to the top of the page
+Quote Post
Kshyhoo
post 6.09.2013, 15:57:46
Post #4





Grupa: Opiekunowie
Postów: 3 855
Pomógł: 317
Dołączył: 4.01.2005
Skąd: że




Cytat(goku131 @ 6.09.2013, 16:57:02 ) *
mozna jasniej/?

Tylko Ty wiesz, co masz w 72 linii kodu...


--------------------
Go to the top of the page
+Quote Post
goku131
post 6.09.2013, 16:08:52
Post #5





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 6.09.2013

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


  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2.  
  3. <head>
  4.  
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8">
  6.  
  7. <META NAME="Description" content="opis strony">
  8.  
  9.  
  10. <meta name="Keywords" content="tagi">
  11.  
  12. <link rel="stylesheet" href="style.css" type="text/css">
  13.  
  14. </head>
  15.  
  16.  
  17. <div id="content">
  18.  
  19.  
  20. <?
  21. require_once('config.php');
  22.  
  23. ?></font>
  24.  
  25. <div id="header">
  26.  
  27.  
  28.  
  29. </div>
  30.  
  31. <div id="pasek_menu">
  32.  
  33. <div class="a_menu">
  34.  
  35. <ul id="menu">
  36.  
  37. <li><a href="index.php" title=""><span>Home</span></a></li>
  38.  
  39. <li><a href="index.php" title=""><span>Serwery</span></a></li>
  40.  
  41. <li><a href="serwery.html" title=""><span>serwery</span></a></li>
  42.  
  43. <li><a href="kontakt.html" title=""><span>Kontakt</span></a></li>
  44.  
  45. </ul>
  46.  
  47. </div>
  48. <a class="a_zrealizowane" href="addServer.php"></a>
  49. </div>
  50.  
  51. <div id="tresc">
  52.  
  53. <div align="center">
  54. <br />
  55.  
  56. <table class="servers">
  57. <tr>
  58. <td>Nazwa</td>
  59. <td>IP</td>
  60. <td>Typ</td>
  61. <td>Graczy</td>
  62. <td>Mapa</td>
  63. </tr>
  64. <?php
  65.  
  66. require "class.hlsocket.php";
  67. require_once('config.php');
  68. $query = mysql_query( "SELECT * FROM `server`" );
  69. $data = array();
  70. while ( $row = mysql_fetch_assoc( $query ) )
  71. {
  72. $ip = explode( ":", $row['ip'] );
  73. $status = new HLSocket( $ip[0], $ip[1] );
  74.  
  75. $array = $status->details();
  76. if ( empty( $array['hostname'] ) )
  77. {
  78. continue;
  79. }
  80. $array["type"] = $row["type"];
  81. $array["ip"] = $row["ip"];
  82.  
  83. $data[] = $array;
  84. }
  85.  
  86. foreach ( $data as $server ):
  87. ?>
  88. <tr>
  89. <td><?php echo $server['hostname']; ?></td>
  90. <td><?php echo $server['ip']; ?></td>
  91. <td><?php echo $server['type']; ?></td>
  92. <td><?php echo $server['players']. "/<span style=\"color: green;\">" .$server['max']. "</span>"; ?></td>
  93. <td><?php echo $server['map']; ?></td>
  94. </tr>
  95. <?php
  96. endforeach;
  97.  
  98. mysql_close();
  99.  
  100. ?>
  101.  
  102.  
  103. </div>
  104.  
  105. <div id="box_right">
  106.  
  107. </div>
  108.  
  109. </div>
  110.  
  111. <div id="stopka">
  112.  
  113. <div class="copyright"></div>
  114.  
  115. <div class="autor">Szablon: Włodziu Skrypt: <a href="http://www.smix.xaa.pl">SmiX</a></div>
  116.  
  117. </div>
  118.  
  119. </div>
  120.  
  121.  
  122.  
  123. <br>
  124.  
  125. </div>
  126.  
  127. </body>
  128.  
  129.  
  130.  
  131. </body>



oto ci chodzi.


ktoś pomożę.
Go to the top of the page
+Quote Post
Turson
post 6.09.2013, 16:10:42
Post #6





Grupa: Zarejestrowani
Postów: 4 291
Pomógł: 829
Dołączył: 14.02.2009
Skąd: łódź

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


mysql_fetch_array zamiast assoc

W błędzie masz jak wół napisane o co chodzi

Ten post edytował TursoN 6.09.2013, 16:11:19
Go to the top of the page
+Quote Post
Kshyhoo
post 6.09.2013, 16:13:13
Post #7





Grupa: Opiekunowie
Postów: 3 855
Pomógł: 317
Dołączył: 4.01.2005
Skąd: że




A 72 linię też mamy wywróżyć?


--------------------
Go to the top of the page
+Quote Post
goku131
post 6.09.2013, 16:18:02
Post #8





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 6.09.2013

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


dalej ten sam blad.

Linia 72

  1. while ( $row = mysql_fetch_assoc( $query ) )
Go to the top of the page
+Quote Post
martex
post 6.09.2013, 16:32:17
Post #9





Grupa: Zarejestrowani
Postów: 133
Pomógł: 4
Dołączył: 7.11.2012
Skąd: Połaniec

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


$row = mysql_fetch_array( $query )
Go to the top of the page
+Quote Post
webdice
post 6.09.2013, 22:45:55
Post #10


Developer


Grupa: Moderatorzy
Postów: 3 045
Pomógł: 290
Dołączył: 20.01.2007




Proszę poprawić tytuł tematu na zgodny z regulaminem forum.
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 27.04.2024 - 01:28