„threadr/boards/index.php“ ändern

master
Jakob 2020-02-19 22:23:41 +01:00
parent 1f04842feb
commit 368d93b997
1 changed files with 6 additions and 8 deletions

View File

@ -6,11 +6,10 @@
</head>
<body>
<?php
try {
$pdo = new PDO('mysql:host=localhost;dbname=web', 'webstuff', 'Schei// auf Pa$$w0rter!');
$error = false;
$error_message = "";
$pdo = new PDO('mysql:host=localhost;dbname=web', 'webstuff', 'Schei// auf Pa$$w0rter!');
$error = false;
$error_message = "";
if (!$error) {
$statement = $pdo->prepare("SELECT name FROM boards");
$statement->execute();
@ -21,11 +20,10 @@
}
echo "</ul>"
}
catch(PDOException $Exception) {
if (!$result) {
$error_message = "Error: SQL error.\n" . $statement->queryString . "\n" . $statement->errorInfo()[2];
}
$pdo = null;
?>
</body>
</html>