Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Powielanie wyników
dela
post
Post #1





Grupa: Zarejestrowani
Postów: 69
Pomógł: 0
Dołączył: 16.06.2009

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


Chciałbym w dwóch miejscach wczytać dane z bazy danych coś w tym stylu:
  1. <?php
  2. include 'ConnectDB.php';
  3.  
  4. $query = 'SELECT * FROM `tables` LIMIT 0 , 30';
  5. $result = mysql_query($query);
  6.  
  7. print ("<HTML>\n");
  8. print ("<HEAD>\n");
  9. print ("<script type='text/javascript'>\n");
  10. print ("\t$(document).ready(function(){\n");
  11. while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
  12. echo ("\t$('#".$row['name']."')\n");
  13. }
  14. print ("\t})\n");
  15. print ("</script>\n");
  16. print ("</HEAD>\n");
  17. print ("<BODY>\n");
  18. while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
  19. echo $row['name'];
  20. }
  21. print ("</BODY>\n");
  22. print ("</HTML>\n");
  23.  
  24. mysql_free_result($result);
  25. ?>
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: 24.12.2025 - 16:47