„threadr/boards/index.php“ ändern

master
Erik 2020-03-02 08:40:56 +01:00
parent 89aded6535
commit 1dadb99d8b
1 changed files with 15 additions and 16 deletions

View File

@ -18,22 +18,20 @@ $navbar="boards";
<div class="item-1"> <div class="item-1">
<h1><center>ThreadR Boards</center></h1> <h1><center>ThreadR Boards</center></h1>
</div> </div>
<div class="item-2 shadow"> <div class="item-2">
<div class="shadow">
<ul class="list"> <ul class="list">
<?php <?php
$pdo = new PDO('mysql:host=localhost;dbname=web', 'webstuff', 'Schei// auf Pa$$w0rter!'); $pdo = new PDO('mysql:host=localhost;dbname=web', 'webstuff', 'Schei// auf Pa$$w0rter!');
$error = false; $error = false;
$error_message = ""; $error_message = "";
if (!$error) { if (!$error) {
$statement = $pdo->prepare("SELECT * FROM boards"); $statement = $pdo->prepare("SELECT * FROM boards");
$statement->execute(); $statement->execute();
foreach($statement->fetchAll() as $ROW) { foreach($statement->fetchAll() as $ROW) {
echo "<li><a href='%CONTENT_DIR%/boards?=$ROW[id]'>$ROW[name]</a></li>"; echo "<li><a href='%CONTENT_DIR%/boards?=$ROW[id]'>$ROW[name]</a></li>";
} }
} }
if (!$result) { if (!$result) {
$error_message = "Error: SQL error.\n" . $statement->queryString . "\n" . $statement->errorInfo()[2]; $error_message = "Error: SQL error.\n" . $statement->queryString . "\n" . $statement->errorInfo()[2];
} }
@ -41,5 +39,6 @@ $navbar="boards";
</ul> </ul>
</div> </div>
</div> </div>
</div>
</body> </body>
</html> </html>