1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| <?php
// Connexion PDO
try {
$bdd = new PDO('mysql:host=localhost;dbname=Arbitrage', 'root', '*****');
} catch (PDOException $e) {
die( 'Erreur de connexion avec la base de données - veuillez contacter votre administrateur' );
}
// Recuperation des Ids des compteurs selectionnes et alimentation du tableau Arbitres_table
$Arbitres_table = array();
$sql = "SELECT * FROM Arbitres";
try {
$result_pdo = $bdd->query($sql);
$Arbitres=array();
while ($arbitre=$result_pdo->fetch() ) {
$Arbitres[$arbitre['Id']] = $arbitre;
}
} catch (PDOException $e) {
print_r($_POST);
die( "Erreur SQL avec la base de données - veuillez contacter votre administrateur ($sql)" );
}
echo "<table>\r\n";
echo "\t<tr><th>Licence</th><th>Nom</th><th>Prenom</th><th>Centre</th><th>Qualites<th></th><th>Sexe</th><th>Age</th><th>Telephone</th>
<th>Mail</th><th>Naissance</th><th>Club</th></tr>";
foreach ($Arbitres as $id=>$props) {
echo "\t<tr>";
echo "<td>".$props['licence']."</td>";
echo "<td>".$props['nom']."</td>";
echo "<td>".$props['prenom']."</td>";
echo "<td>".$props['centre']."</td>";
echo "<td>".$props['qualites']."</td>";
echo "<td>".$props['sexe']."</td>";
echo "<td>".$props['age']."</td>";
echo "<td>".$props['telephone']."</td>";
echo "<td>".$props['mail']."</td>";
echo "<td>".$props['naissance']."</td>";
echo "<td>".$props['club']."</td>";
echo "\t</tr>";
}
echo "</table>\r\n";
?> |
Partager