Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once("../yleiset/yla.php");
- //TODO: Osallistujien (ilmoittautuminen-taulusta) tulostaminen.
- $dbConnection=mysql_pconnect("localhost", "root", "");
- mysql_select_db("terwamaraton");
- $sql="SELECT * FROM ilmoittautuminen ORDER BY nimi asc";
- $statement=mysql_query($sql);
- print "<h3>Osallistujat</h3>";
- if (!$statement)
- {
- $error=mysql_error();
- print $error;
- mysql_close($dbConnection);
- exit;
- }
- print "<table>";
- print "<tr><td></td><td>Nimi</td><td>Seura</td></tr>";
- while ($dataArray=mysql_fetch_assoc($statement))
- {
- print "<tr>";
- print "<td>";
- print "$dataArray[id] ";
- print "</td>";
- print "<td>";
- print "$dataArray[nimi] ";
- print "</td>";
- print "<td>";
- print "$dataArray[seura] ";
- print "</td>";
- print "</tr>";
- }
- print "</table>";
- //Jos teet lisätehtävän, sivun alussa pitää lukea mahdollinen get-parametrin arvo ja muodostaa sen
- //perusteella sql-lauseen order by osa.
- ?>
- <?php
- include_once("../yleiset/ala.php");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement