Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang='pl'>
- <head>
- <title>Szkoła Ponadgimnazjalna</title>
- <link rel="Stylesheet" type="text/css" href="styl.css" />
- </head>
- <body>
- <header>
- <h1 id='logo'>Oceny uczniów: Język Polski</h1>
- </header>
- <section id="left"><!--Lewy-->
- Lista uczniów
- <?php lista();?>
- </section>
- <section id="right"><!--Prawy-->
- <p>Średnia ocen z jezyka polskiego</p>
- </section>
- <footer>
- <h3>Zespół Szkół Ponadgimnazjalnych</h3>
- </footer>
- </body>
- </html>
- <?php
- $user = "root";
- $pass = "";
- $host="localhost";
- $db="szkola_4e";
- function lista(){
- $polaczenie= new mysqli('$host', '$user', '$pass', '$szkola_4e');
- $query1="SELECT * FROM uczen";
- $query2="SELECT * FROM uczen WHERE id='2'";
- $query3="SELECT * FROM `ocena` WHERE przedmiot_id='1' AND uczen_id='2'";
- $query4="SELECT AVG(ocena) FROM `ocena` WHERE przedmiot_id='1' AND uczen_id='2'";
- $wynik=$polaczenie->query($query1);
- $ilosc=$wynik->num_rows();
- $dane=$wynik->fetch_array();
- echo $ilosc;
- for($a=0; $a<$ilosc; $a++){
- $imie= $wynik['imie'];
- }
- $polaczenie->close();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement