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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
</head>
<body>
<form method='POST' action='supprimer.php'>
<table width="685" align="center"border="1">
<tr align="center" bgcolor="#aacc19">
<td width="20%"><font face="comic sans ms"><b>Nom</b></font></td>
<td width="20%"><font face="comic sans ms"><b>Prenom</b></font></td>
<td width="35%"><font face="comic sans ms"><b>Choix</b></font> </td>
<font face="comic sans ms"><b>Supprimer</b></font></td>
</tr>
<?php
//Connection à la base ou sortie si échec
$db = pg_connect("host=127.0.0.1 port=5432 dbname=mabase user=postgres password=pwd") or die('Follow the white rabbit : ' . pg_last_error());
// Lancement de la requête
$query = 'SELECT * FROM "GlobalIntervenant"';
$result = pg_query($db, $query) or die('Follow the white rabbit : ' . pg_last_error());
// Sortie du résultat en tableau
/*$data = pg_num_rows($result);
if ($data == 0)
{
echo '<tr><td colspan="2">';
echo 'Aucune entrée trouvée!</td></tr>';
}
*/
$data = pg_fetch_all($result);
foreach($data as $row)
{
echo "<tr>";
echo "<td>".$row['Nom']."</td>";
echo "<td>".$row['Prenom']."</td>";
echo "<td>".$row['ID']."</td>";
echo "</tr>";
}
// Libère le résultat
pg_free_result($result);
// Ferme la connexion
pg_close($db);
?>
<input accesskey="S" name="Supprimer" value="Supprimer" type="submit">
</form>
</table>
</body>
</html> |
Partager