Advertisement
Guest User

Untitled

a guest
Oct 30th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang='pl'>
  3.  
  4. <head>
  5. <title>Szkoła Ponadgimnazjalna</title>
  6. <link rel="Stylesheet" type="text/css" href="styl.css" />
  7. </head>
  8. <body>
  9. <header>
  10. <h1 id='logo'>Oceny uczniów: Język Polski</h1>
  11. </header>
  12. <section id="left"><!--Lewy-->
  13. Lista uczniów
  14. <?php lista();?>
  15. </section>
  16. <section id="right"><!--Prawy-->
  17. <p>Średnia ocen z jezyka polskiego</p>
  18. </section>
  19. <footer>
  20. <h3>Zespół Szkół Ponadgimnazjalnych</h3>
  21. </footer>
  22. </body>
  23. </html>
  24. <?php
  25. $user = "root";
  26. $pass = "";
  27. $host="localhost";
  28. $db="szkola_4e";
  29.  
  30. function lista(){
  31. $polaczenie= new mysqli('$host', '$user', '$pass', '$szkola_4e');
  32.  
  33.  
  34. $query1="SELECT * FROM uczen";
  35. $query2="SELECT * FROM uczen WHERE id='2'";
  36. $query3="SELECT * FROM `ocena` WHERE przedmiot_id='1' AND uczen_id='2'";
  37. $query4="SELECT AVG(ocena) FROM `ocena` WHERE przedmiot_id='1' AND uczen_id='2'";
  38.  
  39. $wynik=$polaczenie->query($query1);
  40. $ilosc=$wynik->num_rows();
  41. $dane=$wynik->fetch_array();
  42. echo $ilosc;
  43. for($a=0; $a<$ilosc; $a++){
  44. $imie= $wynik['imie'];
  45. }
  46.  
  47. $polaczenie->close();
  48.  
  49. }
  50. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement