Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Sportowcy</title>
- <link rel="stylesheet" type="text/css" href="styl.css">
- </head>
- <body>
- <div id="baner">
- <h1>Klub sportowy: biegi kobiet na 100m</h1>
- </div>
- <div id="glowny">
- <?php
- $idSportowca = 1;
- $conn = mysqli_connect('localhost','administrator','1357','sportowcy');
- mysqli_query($conn,"SET CHARSET utf8");
- $q = mysqli_query($conn, 'SELECT AVG(wynik) as sr FROM wyniki WHERE dyscyplina_id=1');
- $q1 = mysqli_query($conn, 'SELECT COUNT(*) as rekordy FROM sportowiec');
- $a1 = mysqli_fetch_array($q);
- $a2 = mysqli_fetch_array($q1);
- echo "<h1>Sredni wynik naszych biegaczek: ".$a1['sr']." s</h1>";
- echo "<table>";
- for($i = 0; $i<$a2['rekordy']/3; $i++)
- {
- echo "<tr>";
- for($j = 0; $j<3; $j++)
- {
- $q = mysqli_query($conn, 'SELECT imie as imie,nazwisko as nazwisko FROM sportowiec WHERE id='.$idSportowca.'');
- $q1 = mysqli_query($conn, 'SELECT wynik as wynik FROM wyniki WHERE sportowiec_id='.$idSportowca.' AND dyscyplina_id=1 ORDER BY wynik ASC');
- $a = mysqli_fetch_array($q);
- $a1 = mysqli_fetch_array($q1);
- echo
- "<td>
- <h3>".$a['imie']." ".$a['nazwisko']."</h3>
- <p>Najlepszy wynik: ".$a1['wynik']."</p>
- </td>";
- $idSportowca++;
- }
- echo "</tr>";
- }
- echo "</table>";
- ?>
- </div>
- <div id="stopka">
- <p>
- Klub sportowy <br>
- Stronę opracował: 12345678901
- </p>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement