<?php
$db = new PDO('mysql:host=localhost;dbname=jeux_de_combat', 'root', '');
$monManager = new PersonnageManager($db);

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Lobby</title>
</head>
<body>
    <h1>Le commencement...</h1>

    <a href="">Créer vôtre personnage</a><br>

    <h2>Où</h2>

<?php
echo "
    <p>Sélectionnez votre personnage</p>

    <select name='id' id='id'>Selectionner vôtre personnage
    ";
    $requete = "SELECT * FROM personnage";
        $stmt = $db->prepare($requete);
        $stmt->execute();

        $result = $stmt->fetchAll(PDO::FETCH_ASSOC);
        foreach ($result as $perso) {
    echo"
        <option value='{$perso['id']}'>{$perso['name']}</option>
        ";
        }
    echo"
    </select>
    ";

?>

<a href="index.php">Commencez le combat</a>

</body>
</html>