„threadr/boards/index.php“ ändern

master
Jakob 2020-02-19 22:20:25 +01:00
parent 627b069a67
commit 1f04842feb
1 changed files with 19 additions and 23 deletions

View File

@ -5,31 +5,27 @@
<link rel="stylesheet" type="text/css" href="%CONTENT_DIR%/style.css">
</head>
<body>
<div class="container">
<div class="item-1">
<?php
try {
$pdo = new PDO('mysql:host=localhost;dbname=web', 'webstuff', 'Schei// auf Pa$$w0rter!');
$error = false;
$error_message = "";
<?php
try {
$pdo = new PDO('mysql:host=localhost;dbname=web', 'webstuff', 'Schei// auf Pa$$w0rter!');
$error = false;
$error_message = "";
$statement = $pdo->prepare("SELECT name FROM boards");
$statement->execute();
$statement = $pdo->prepare("SELECT name FROM boards");
$statement->execute();
echo "<ul class="topnav">"
foreach($statement->fetchAll() as $ROW) {
echo "
<li><a href='%CONTENT_DIR%/boards#$ROW[id]'>$ROW[name]</a></li>";
}
echo "</ul>"
}
catch(PDOException $Exception) {
$error_message = "Error: SQL error.\n" . $statement->queryString . "\n" . $statement->errorInfo()[2];
}
echo "<ul class="topnav">"
foreach($statement->fetchAll() as $ROW) {
echo "
<li><a href='%CONTENT_DIR%/boards#$ROW[id]'>$ROW[name]</a></li>";
}
echo "</ul>"
}
catch(PDOException $Exception) {
$error_message = "Error: SQL error.\n" . $statement->queryString . "\n" . $statement->errorInfo()[2];
}
$pdo = null;
?>
</div>
</div>
$pdo = null;
?>
</body>
</html>