something's broken

master
Jakob 2020-03-04 11:01:05 +01:00
parent 0a6efeb54b
commit bc5182c179
1 changed files with 1 additions and 3 deletions

View File

@ -25,9 +25,8 @@ $navbar="boards";
$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 = "";
echo "<p>Public boards:</p>"
if (!$error) { if (!$error) {
$statement = $pdo->prepare("SELECT * FROM boards ORDER BY id asc"); $statement = $pdo->prepare("SELECT * FROM boards WHERE public = '1' ORDER BY id asc");
$statement->execute(); $statement->execute();
foreach($statement->fetchAll() as $ROW) { foreach($statement->fetchAll() as $ROW) {
echo "<li><a href='%CONTENT_DIR%/boards/thread.php?id=$ROW[id]'>$ROW[name]</a></li>"; echo "<li><a href='%CONTENT_DIR%/boards/thread.php?id=$ROW[id]'>$ROW[name]</a></li>";
@ -37,7 +36,6 @@ $navbar="boards";
$error_message = "Error: SQL error.\n" . $statement->queryString . "\n" . $statement->errorInfo()[2]; $error_message = "Error: SQL error.\n" . $statement->queryString . "\n" . $statement->errorInfo()[2];
} }
if ($login) { if ($login) {
echo "<p>Private boards:</p>"
if (!$error) { if (!$error) {
$statement = $pdo->prepare("SELECT * FROM boards WHERE public='0' ORDER BY id asc"); $statement = $pdo->prepare("SELECT * FROM boards WHERE public='0' ORDER BY id asc");
$statement->execute(); $statement->execute();