„threadr/boards/index.php“ ändern
parent
1f04842feb
commit
368d93b997
|
@ -6,11 +6,10 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<?php
|
<?php
|
||||||
try {
|
|
||||||
$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) {
|
||||||
$statement = $pdo->prepare("SELECT name FROM boards");
|
$statement = $pdo->prepare("SELECT name FROM boards");
|
||||||
$statement->execute();
|
$statement->execute();
|
||||||
|
|
||||||
|
@ -21,11 +20,10 @@
|
||||||
}
|
}
|
||||||
echo "</ul>"
|
echo "</ul>"
|
||||||
}
|
}
|
||||||
catch(PDOException $Exception) {
|
|
||||||
|
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];
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdo = null;
|
|
||||||
?>
|
?>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue