该站点应在输入中显示变量内容。变量用数据库中的行填充。即使数据库中有数据,输入也为空。
此外,在“打开请求”下,它应显示数据库中彼此下方的所有用户名。 但是该网站显示“ else”消息。
<form action="" method="post">
<input type="text" id="AantalPer" name="aantalPer" value="<?php echo $request_passagiers; ?>" readonly/>
<input type="text" id="MinLaad" name="minLaad" value="<?php echo $request_laadruimte ?>" readonly/>
<input type="text" id="Mobiel" name="mobiel" value="<?php echo $request_mobiel; ?>" readonly/>
<input type="text" id="Datum" name="datum" value="<?php echo $request_datum; ?>" readonly/>
<input type="text" id="Tijd" name="tijd" value=" " readonly/>
<input type="text" id="Email" name="email" value="<?php echo $request_email; ?>" readonly/>
<input type="submit" name="accept" class="Accept" value="Accepteren"/>
<input type="submit" name="decline" class="Decline" value="Weigeren"/>
</form>
对于请求:
<h3>Open requests</h3>```
<?php
$query = "SELECT
taxi_aanvraag.Gebruikersnaam,
taxi_aanvraag.klantid,
taxi_aanvraag.minimale_laadruimte,
taxi_aanvraag.passagiers,
taxi_aanvraag.lattitude,
taxi_aanvraag.longitude,
taxi_aanvraag.datum,
klant.chauffeurid,
klant.Gebruikersnaam,
klant.naam,
klant.mobiel,
klant.email
FROM taxi_aanvraag
INNER JOIN klant ON
taxi_aanvraag.Gebruikersnaam = klant.Gebruikersnaam";
if($result = mysqli_query($conn, $query)) {
$row_count = mysqli_num_rows($result);
if($row_count > 0) {
while ($row = mysqli_fetch_assoc($result)) {
$request_latitude = $row['lattitude'];
$request_longitude = $row['longitude'];
$request_passagiers = $row['passagiers'];
$request_laadruimte = $row['minimale_laadruimte'];
$request_email = $row['email'];
$request_mobiel = $row['mobiel'];
$request_datum = $row['datum'];
$request_gebruikersnaam = $row['Gebruikersnaam'];
$request_klantid = $row['klantid'];
echo '<p>'. $request_gebruikersnaam .'</p>';
}
}
else {
echo '<p>There are no existing requests.</p>';
}
}