<?php include "core/menu.php";
session_start();
error_reporting(0);
include ('config/config.php')
?>
	<center><form method="post" action="">
<div></strong><select name="objet" required><option value="5">Homme</option><option value="5">Femme</option></select></div>
<br />
<h3>Nom du personnage</h3>
<select name="pseudo">
<option>Choisissez votre personnage...</option>
<optgroup label="Synarius">
<?php
try
{
    $pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
    $bdd = new PDO('mysql:host=localhost;dbname=characters', 'root2', '123', $pdo_options);

    $reponse = $bdd->query("SELECT name, level FROM characters WHERE account = '".$id."'");

    while ($donnees = $reponse->fetch())
    {
	$name = $donnees['name'];
	?>
    <option value="<?php echo $name; ?>"><?php echo $name; ?>
    <?php
    }
    
    $reponse->closeCursor();
}
catch(Exception $e)
{
    die('Erreur : '.$e->getMessage());
}
?>
</optgroup>
</select><br /><br />
<input type="submit" value="Envoyez"></form>
<?php
?>
        </div>
            <div id="contenu_b"></div>
    </div>
        <div id="menu-v">
				<hr />
<?php include "core/menud.php" ?>