Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> problem z wywalniem odpowiednich danych, z bazy, w odpowiedni sposób
fiszol
post
Post #1





Grupa: Zarejestrowani
Postów: 452
Pomógł: 16
Dołączył: 25.05.2004
Skąd: Gorzów Wlkp.

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


skrypt:
  1. <?php
  2. $dbconnect=mysql_connect(&#092;"$dbhost\",\"$dbuser\",\"$dbpasswd\");
  3. $selelctdb=mysql_select_db(&#092;"$dbname\",$dbconnect);
  4. $listalbums=(&#092;" SELECT artist, album, year, genre, bitrate, size, filetype
  5. FROM audio
  6. ORDER BY artist, year ASC
  7. LIMIT 50 &#092;");
  8. $runquery= mysql_query($listalbums);
  9.  
  10. $getlist = mysql_fetch_assoc($runquery);
  11. $artist  = $getlist['artist'];
  12. $album = $getlist['album'];
  13. $year  = $getlist['year'];
  14. $genre = $getlist['genre'];
  15. $bitrate = $getlist['bitrate'];
  16. $size  = $getlist['size'];
  17. $filetype = $getlist['filetype'];
  18.  
  19. for($i=0;$i<mysql_num_rows($runquery);++$i)
  20. {
  21. if ($i < 50 )
  22. echo ($i+1), $artist , &#092;"&nbsp;\", $album, \"&nbsp;\", $year, \"&nbsp;\", $genre, \"&nbsp;\", $bitrate, \"&nbsp;\", $size, \"&nbsp;\", $filetype, \"<br>\";
  23. }
  24.  
  25. ?>


Wywala mi w kółko tylko pierwszy wpis z tabeli
Cytat
1Amon Amarth Versus The World 2000 Melodic Death Metal 224 90 0
2Amon Amarth Versus The World 2000 Melodic Death Metal 224 90 0
3Amon Amarth Versus The World 2000 Melodic Death Metal 224 90 0
4Amon Amarth Versus The World 2000 Melodic Death Metal 224 90 0
itd...

a chciałbym aby wywalał wpisy kolejno, co powinienem zmienić ?

pozdrawiam,
fiszol

Ten post edytował fiszol 6.04.2005, 09:28:46


--------------------
\o/
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
j00seph
post
Post #2





Grupa: Zarejestrowani
Postów: 54
Pomógł: 0
Dołączył: 3.10.2004
Skąd: Taka wiocha koło Cieszyna :P

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


Ja wyciągam dane z bazy w troche inny sposób , ale chyba wiem gdzie leży pies (u ciebie ) pogrzebany ...

Wydaje mi sie ze kod ponieżej powinien leżeć w pętli for , a nie przed nią ...
  1. <?php
  2.  
  3.  $getlist = mysql_fetch_assoc($runquery);
  4. $artist  = $getlist['artist'];
  5. $album = $getlist['album'];
  6. $year  = $getlist['year'];
  7. $genre = $getlist['genre'];
  8. $bitrate = $getlist['bitrate'];
  9. $size  = $getlist['size'];
  10. $filetype = $getlist['filetype'];
  11. ?>


--------------------
"Nemo Sine Vitiis Est" - Ktoś tak kiedyś powiedział... i miał rację.
Go to the top of the page
+Quote Post
fiszol
post
Post #3





Grupa: Zarejestrowani
Postów: 452
Pomógł: 16
Dołączył: 25.05.2004
Skąd: Gorzów Wlkp.

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


dzięki bardzo, już jest cacy smile.gif


--------------------
\o/
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 - 10:03