diff --git a/public/harjoittelupaikat.php b/public/harjoittelupaikat.php
index b037a31..d04c826 100644
--- a/public/harjoittelupaikat.php
+++ b/public/harjoittelupaikat.php
+<?php
+ include "../src/connect.php";
+
+ $sql = "SELECT * FROM harjoittelupaikat";
+ $result = $conn->query($sql);
+
+ $harjoittelupaikat = [];
+ if ($result->num_rows>0) {
+ while($row = $result->fetch_assoc()) {
+ $harjoittelupaikat[] = $row;
+ }
+ } else {
+ echo "Harjoittelupaikkoja ei löytynyt";
+ }
+
+ $conn->close();
+?>
+
<html lang="en">
<head>
<meta charset="UTF-8">
</h1>
<a href="../public/uusharjoittelupaikka.php">Lisää harjoittelupaikka</a>
<main>
- <section>
- <div class="table-container">
- <table>
- <tr>
- <th>Nimi</th>
- <th>Ohjaaja</th>
- <th>Yhteystiedot</th>
- </tr>
- <?php include "../src/hae_harjoittelupaikat.php"; ?>
- </table>
- </div>
- </section>
+ <table>
+ <tr>
+ <th>Nimi</th>
+ <th>Ohjaaja</th>
+ <th>Yhteystiedot</th>
+ </tr>
+ <?php foreach ($harjoittelupaikat as $harjoittelupaikka): ?>
+ <tr>
+ <?php
+ echo "<td>" . $harjoittelupaikka["nimi"] . "</td>";
+ echo "<td>" . $harjoittelupaikka["ohjaaja"] . "</td>";
+ echo "<td>" . $harjoittelupaikka["yhteystiedot"] . "</td>";
+ ?>
+ </tr>
+ <?php endforeach; ?>
+ </table>
</main>
<?php include "../src/footer.php"; ?>
</body>
diff --git a/src/hae_harjoittelupaikat.php b/src/hae_harjoittelupaikat.php
deleted file mode 100644
index 06b335a..0000000
--- a/src/hae_harjoittelupaikat.php
+++ /dev/null
-<?php
-include "../src/connect.php";
-
-$sql = "SELECT * FROM harjoittelupaikat";
-$result = $conn->query($sql);
-
-if ($result->num_rows>0) {
- while($row = $result->fetch_assoc()) {
- echo "<tr>";
- echo "<td>" . $row["nimi"] . "</td>";
- echo "<td>" . $row["ohjaaja"] . "</td>";
- echo "<td>" . $row["yhteystiedot"] . "</td>";
- echo "</tr>";
- }
-} else {
- echo "Harjoittelupaikkoja ei löytynyt";
-}
-
-$conn->close();
-?>