<html>
        <p>
            <label for="tnummer">Teilnehmernummer: </label>
            <input type="text" name="tnummer" id="tnummer" placeholder="1" required autofocus>
        </p>
        <p>
            <input type="submit" value="Absenden">
            <input type="reset">
        </p>
</html>

<?php

include("list.php");

try {
    $pdo = new PDO("mysql:dbname=$dbname;dbhost=$dbhost;charset=utf8", $dbuser, $dbpw);
} catch (PDOException $e) {
    die($e->getMessage());
}

$tnummer = $_POST['tnummer'];

$sql = "SELECT * FROM teilnehmer WHERE tnummer= :tnummer";


if ($stmt = $pdo->prepare($sql)) {
    $stmt->bindParam(':tnummer',$tnummer);
    $stmt->execute();

    while ($zeile = $stmt->fetch(PDO::FETCH_ASSOC)) {
        echo "Teilnehmernummer: " .$zeile ['tnummer'] . "<br>";
        echo "Name: " .$zeile ['name'] . "<br>";
        echo "Vorname " .$zeile ['vname'] . "<br>";
        echo "Ort: " .$zeile ['ort'] . "<br>";
    }
}

?>


