Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Pusty Rekord
-Helid-
post
Post #1





Goście







  1. <?php
  2. include 'funkcje.php';
  3. pol_mysql();
  4. ?>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml" lang="pl">
  7. <head>
  8. <title>Shooters.pl :: Najlepsze Serwery Gier Multiplayer</title>
  9. <meta name="Description" content="Serwery gier do Twoich ulubionych gier! Serwery gier oparte o najnowsze tec
    hnologie, Shooters.PL Najlepsze Serwery Gier Multiplayer - Satysfakcja Gwarantowana" />
  10. <meta name="Keywords" content="serwery gier, serwery bnc, serwery counter, serwery, gier, serwer, gry, wyn
    ajem, online, multiplayer, servers, games, server, game, klan, clan, war, klanowy
    , fpp, klany, klanowy, klanowki, unreal, doom, quake, cs, cstrike, source, counte
    r, strike, counterstrike, q3, hl2, half, life, halflife, sof2, raven shield, batt
    lefield, lease, clanservers, mohaa, americas army, team, speak, ventrilo, mecz, t
    rening, enemy territory, et, castle, wolfenstein, games, net, polski, steam, day 
    of defeat, moh, css, polskie, clanservers, shooters, battlefield, medal of honor,
     pacific assault, americas army, team speak, mecz, trening, clan war, day of defe
    at, niskie, najlepsze, pingi" />
  11. <meta name="robots" content="index,all" />
  12. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  13. <link rel="stylesheet" type="text/css" href="http://shooters.pl/media/style.css" />
  14. </head>
  15.  
  16. <body>
  17.  
  18. <div id="bg">
  19. <div id="wrapper">
  20.  
  21. <h1><a href="http://shooters.pl/" title="Shooters.pl - Serwery Gier Multiplayer">Shooters.pl</a></h1>
  22.  
  23. <div id="top"><div id="image">
  24. <img src="http://shooters.pl/media/images/top.jpg" alt="" title="Shooters.pl" />
  25. </div>
  26. <ul>
  27.  
  28.  
  29.  <li id="tab-g" class="active"><a href="http://shooters.pl/index/index.html" title="Glowna"><span><span>Główna</span></span></a></li>
  30.  <li id="tab-m"><a href="http://shooters.pl/index/panel/index.html" title="Moje konto"><span><span>Moje konto</span></span></a></li>
  31.  <li id="tab-s"><a href="http://shooters.pl/index/sponsoring.html" title="Sponsoring"><span><span>Sponsoring</span></span></a></li>
  32.  <li id="tab-r"><a href="http://shooters.pl/index/regulamin.html" title="Regulamin"><span><span>Regulamin</span></span></a></li>
  33.  <li id="tab-c"><a href="http://shooters.pl/index/cennik.html" title="Cennik"><span><span>Cennik</span></span></a></li>
  34.  <li id="tab-p"><a href="http://shooters.pl/index/pomoc.html" title="Pomoc"><span><span>Pomoc</span></span></a></li>
  35.  
  36.  <li id="tab-n"><a href="http://shooters.pl/index/gry.html" title="Lista gier"><span><span>Lista gier</span></span></a></li>
  37.  <li id="tab-o"><a href="http://shooters.pl/index/onas.html" title="O nas"><span><span>O nas</span></span></a></li>
  38.  <li id="tab-k"><a href="http://shooters.pl/index/kontakt.html" title="Kontakt"><span><span>Kontakt</span></span></a></li>
  39.  
  40. </ul>
  41.  
  42. <div class="clear"></div>
  43. </div>
  44.  
  45. <div id="breadcr">
  46. <p>środa, 21 listopad 2007 : 20:27</p>
  47. </div>
  48.  
  49. <div id="main">
  50. <div class="deco1"></div>
  51. <div id="content">
  52.  
  53. <?
  54.  $wynik = mysql_query ("SELECT * FROM news".
  55. "ORDER BY nr DESC LIMIT 0,4");
  56.  
  57. while ($wynik && $rekord = mysql_fetch_array ($wynik)) {
  58. print "
  59. <div class=\"post\">
  60. <div class=\"header\">
  61. <h2>'".$rekord['tytul']."'</h2>
  62. <p>'".$rekord['data']."'</p>
  63.  </div>
  64. <div class=\"body\">";
  65.  print "'".$rekord['tresc_krotka']."'</div>";
  66.  echo "  <div class=\"confirm\">
  67. <p>
  68. <a class=\"comms\" href=\"http://shooters.pl/index/komentarze,nid,43.html\">Komentarze (25)</a>
  69. </p>
  70. </div>
  71. <div class=\"hr\"><hr /></div>
  72. </div>";
  73. }
  74. ?>
  75.  
  76.  
  77. </div>
  78.  
  79. <div id="sidebar">
  80.  
  81. <form action="http://shooters.pl/index/panel/login.html" method="post">
  82. <h3>
  83. <span class="ico3">Logowanie</span>
  84. </h3>
  85.  
  86. <!-- <br /> -->
  87. <fieldset>
  88. <br />
  89. <p class="text">
  90. <label for="user-login" style="margin: 8px">Login:</label>
  91. <input id="user-login" name="userlogin" type="text" size="30" />
  92. </p>
  93. <p class="text">
  94.  
  95. <label for="user-pass" style="margin: 8px">Hasło:</label>
  96. <input id="user-pass" type="password" name="userpass" size="30" />
  97. </p>
  98. <p class="submit">
  99. <input type="submit" value="Zaloguj" />
  100. </p>
  101. </fieldset>
  102. </form>
  103.  
  104. <p class="text" id="textprawo">
  105. <a href="http://shooters.pl/index/rejestracja.html"><b>Załóż nowe konto</b></a><br /><br />
  106. </p>
  107.  <h3><span class="ico2">Przyjaciele</span></h3>
  108. <ul class="links">
  109. <li><a href="http://www.americasarmy.pl"><strong>AmericasArmy.pl</strong></a></li>
  110. <li><a href="http://www.tibia.pl"><strong>Tibia.pl</strong></a></li>
  111.  
  112. <li><a href="http://www.esports.pl"><strong>eSports.pl</strong></a>
  113. </li>
  114.  </ul>
  115.  
  116. <br />
  117. <h3><span class="ico1">Partnerzy</span></h3>
  118. <br />
  119. <div id="partnerzyimg1">
  120. <a href="http://www.cybersport.pl/" onclick="window.open(this.href);return false"><img src="http://shooters.pl/media/images/cybersport.jpg" alt="cybersport" /></a>
  121. </div>
  122. <br />
  123.  
  124. <div id="partnerzyimg2">
  125. <img src="http://shooters.pl/media/images/wcg.jpg" alt="wcg.pl" />
  126. </div>
  127. <br />
  128. <div id="partnerzyimg7">
  129. <a href="http://www.pgs-gaming.pl/" onclick="window.open(this.href);return false" rel="nofollow"><img src="http://shooters.pl/media/images/pgsnew.png" alt="pgsgaming" /></a>
  130. </div>
  131. <br />
  132. <div id="partnerzyimg3">
  133. <img src="http://shooters.pl/media/images/sss_03.gif" alt="pragmatic" />
  134. </div>
  135. <br />
  136. <div id="partnerzyimg4">
  137. <img src="http://shooters.pl/media/images/sss_07.jpg" alt="aahonor" />
  138.  
  139. </div>
  140. <br />
  141. <h3><span class="ico1">Powered by</span></h3>
  142. <br />
  143. <div id="partnerzyimg5">
  144. <img src="http://shooters.pl/media/images/glowna_03.gif" alt="WDC" />
  145. </div>
  146. <br />
  147. <div id="partnerzyimg6">
  148. <img src="http://shooters.pl/media/images/glowna_10.gif" alt="intel" />&nbsp;&nbsp;&nbsp;<img src="http://shooters.pl/media/images/glowna_12.gif" alt="cisco" />
  149. </div>
  150. </div>
  151.  
  152.  
  153.  
  154. <div class="deco2"></div>
  155. </div>
  156.  
  157. <div id="footer">
  158.  
  159. <address><span>www.<a href="http://devonstudio.com"><b>DevonStudio</b></a>.com</span> <a href=""><b>Shooters</b>.pl Sp. z o.o.</a> 2006 - 2007 &copy; Wszelkie prawa zastrzeżone</address>
  160.  
  161.  
  162. </div>
  163. </div>
  164. </div>
  165. </body>
  166. </html>

I dziwne nic nie wyświetla a w bazie są rekordy i połaczenie działa
Strona
  1. <?php
  2. <a href=&#092;"http://78.146.182.162/~vxz/lo.php\" target=\"_blank\">http://78.146.182.162/~vxz/lo.php</a>
  3. ?>

O szbalonie prosze nie pisać chwilowy!
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 6)
dadexix
post
Post #2





Grupa: Zarejestrowani
Postów: 439
Pomógł: 21
Dołączył: 28.06.2007
Skąd: Bielsko-Biała

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


Kod
while ($wynik && $rekord = mysql_fetch_array ($wynik)) {

za bbardzo nie rozumiem... nie lepiej tak:
Kod
while ($rekord = mysql_fetch_array($wynik)) {


--------------------
"Na przykład zmiennej $jestem_najlepszy przypisujemy wartość logiczną TRUE"
Ja: użyj funkcji[...]
Grins: mów normalnie do mnie a nie po polsku
Ja: normalnie to znaczy jak?
Grins: No w PHP... inaczej mój parser ledwo kuma:)
Go to the top of the page
+Quote Post
-Helid-
post
Post #3





Goście







Nie działa:
  1. <?php
  2. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in E:ProgramyWebServhttpd-usersvxzlo.php on line 57
  3. ?>
Go to the top of the page
+Quote Post
nospor
post
Post #4





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Cytat
za bbardzo nie rozumiem... nie lepiej tak:
Dzieki temu unikal tego bledu co wlasnie pokazal tongue.gif

nie:
  1. <?php
  2. $wynik = mysql_query ("SELECT * FROM news".
  3. "ORDER BY nr DESC LIMIT 0,4");
  4. ?>

a:
  1. <?php
  2. $wynik = mysql_query ("SELECT * FROM news ".
  3. "ORDER BY nr DESC LIMIT 0,4");
  4. ?>

Spacja tez wazna rzecz winksmiley.jpg

a na przyszlosc:
  1. <?php
  2. $wynik = mysql_query ("SELECT * FROM news ".
  3. "ORDER BY nr DESC LIMIT 0,4") or die(mysql_error());
  4. ?>


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
Moli
post
Post #5





Grupa: Zarejestrowani
Postów: 662
Pomógł: 45
Dołączył: 26.03.2007
Skąd: Warszawa

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


Dodaj po pętli
  1. <?php
  2. if( !empty ( $rekord ) ) {
  3. // wyswietlanie rekordów
  4. }
  5. ?>
Go to the top of the page
+Quote Post
-Helid-
post
Post #6





Goście







DObra naprawiełm
Kod
$wynik = mysql_query ("SELECT * FROM news ORDER BY nr DESC LIMIT 0,4");

while ($wynik && $rekord = mysql_fetch_array ($wynik)) {

Temat do zamknięcia biggrin.gif
Go to the top of the page
+Quote Post
in5ane
post
Post #7





Grupa: Zarejestrowani
Postów: 1 335
Pomógł: 34
Dołączył: 9.11.2005
Skąd: Wrocław

Ostrzeżenie: (10%)
X----


  1. <?php
  2. $query = "SELECT * FROM news ORDER by nr DESC LIMIT 0,4";
  3. $result = mysql_query($query);
  4. while ($row = mysql_fetch_array($result)) {
  5.  
  6. }
  7. ?>


I teraz będziesz miał wszystkie dane pod taka zmienną: $row['tytul'] albo $row['data'] albo $row['tresc_krotka'].

Pzdr..


--------------------
> > > Tworzenie stron < < <
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 Aktualny czas: 20.08.2025 - 07:37