echo " <th>Réserver</th>\n";
echo " </tr>\n";
foreach ($fligths as $fligth) {
- $sql_pquery = "select sum(NbPlaces) from RESERVATIONS where NumVol = ?";
+ $sql_pquery = "select sum(NbPlaces) as BookedPlaces from RESERVATIONS where NumVol = ?";
$connection->prepare_query($sql_pquery);
$connection->prepared_query_bind_param("s", array($fligth['NumVol']));
$connection->run_prepared_query();
echo " <td>" . $fligth['Classe'] . "</td>\n";
echo " <td>" . $fligth['Prix'] . "€</td>\n";
echo " <td>
- Places libres : " . $free_places . "
+ Nombre de places libres : " . $free_places . "
<form action=\"index.php\" id=\"booking\" method=\"post\">
<input type=\"hidden\" name=\"form\" value=\"booking\" />
<input type=\"hidden\" name=\"flight_id\" value=\"" . $fligth['NumVol'] . "\" />