Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> wczytywanie rekordu mysql
zero-gravity
post
Post #1





Grupa: Zarejestrowani
Postów: 38
Pomógł: 0
Dołączył: 9.12.2011

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


Zrobiłem taki kod:

  1. <?php
  2. define('DB_HOST','mysql.cba.pl');
  3. define('DB_USER','sasp1');
  4. define('DB_PASS','marcin');
  5. define('DB_NAME','sasp_cba_pl');
  6. mysql_connect(DB_HOST,DB_USER,DB_PASS,true)or die(mysql_error());
  7.  
  8.  
  9. $query = mysql_query("select * from support order by data desc")or die(mysql_error());
  10.  
  11. echo '<table id="tab">
  12. <tr><th><center>ID </center></th><th>NICK</th><th>WIEK</th><th>Akcja</th></tr>';
  13.  
  14. while($r=mysql_fetch_array($query)){
  15. echo '<tr>';
  16. echo '<td>'.$r['id'].'</td>';
  17. echo '<td>'.$r['pole'].'</td>';
  18. echo '<td>'.$r['nick'].'</td>';
  19. echo '<td><a href="book.php?id='.$r['id'].'"> [Przeczytaj]</A><td>';
  20. echo '</tr>';
  21. }
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30. echo '</table>';
  31. ?>



A jak zrobić aby wczytało mi dany rekord? np. book.php?id=1
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: 22.08.2025 - 14:19