Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]Odczyt bazy danych w php
Jarek099
post
Post #1





Grupa: Zarejestrowani
Postów: 28
Pomógł: 0
Dołączył: 14.01.2010
Skąd: Słupsk

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


Witam mam taki kod :

  1. <?
  2. include 'dial.php'; // Połączenie mysql
  3.  
  4. $mysql = mysql_connect($host, $user, $password);
  5. mysql_select_db($baza, $mysql);
  6. $zapytanie= "SELECT * FROM `tabela`";
  7. $query=mysql_query($zapytanie);
  8. while($row=mysql_fetch_array($query)){
  9. $id = $row['0'];
  10. $imie = $row['1'];
  11. $nazwisko = $row['2'];
  12. $pseudo = $row['3'];
  13.  
  14. }
  15. <table width="800" border="1">
  16. <td width="50" align="center">id.</td> <td width="225" align="center">imie</td> <td width="225" align="center">nazwisko</td> <td width="200" align="center">pseudo</td>
  17. <tr>
  18. <td width="50" align="center">' . $id . '</td> <td width="225" align="center">' . $imie . '</td> <td width="225" align="center">' . $nazwisko . '</td> <td width="200" align="center">' . $pseudo . '</td>
  19. </tr>
  20. <tr>
  21. <td width="50" align="center">' . $id . '</td> <td width="225" align="center">' . $imie . '</td> <td width="225" align="center">' . $nazwisko . '</td> <td width="200" align="center">' . $pseudo . '</td>
  22. </tr>
  23. <tr>
  24. <td width="50" align="center">' . $id . '</td> <td width="225" align="center">' . $imie . '</td> <td width="225" align="center">' . $nazwisko . '</td> <td width="200" align="center">' . $pseudo . '</td>
  25. </tr>
  26. </table>');
  27. ?>


I pokazuje mi tylko ostanio dodaną 1 osobe w 3 tabelach.
A jak napisać by pokazywało 3 ostatnich użytkowników ?
Bo sie męcze i męcze tongue.gif aż ksiązke zamówiłem ale dojdzie za tydzień gdzieś :|
Pomożecie ?

Ten post edytował Jarek099 12.02.2010, 15:24:58
Go to the top of the page
+Quote Post

Posty w temacie


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: 22.08.2025 - 00:49