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