1
沒有結果時,我想顯示「沒有該活動的門票」,否則顯示票據數據。沒有找到結果返回的信息
Waht代碼有誤嗎?
<?php
$result = mysqli_query($con,"SELECT * FROM ticket WHERE eventID = ".$_GET['eventID'] ." ORDER by ticketEDate ASC");
while($row = mysqli_fetch_array($result, MYSQL_BOTH)) {
if (mysqli_num_rows($result) ==0){
echo "There are no tickets for this event";
} else {
echo '<tr>
<td><h8>Ticket voor: </h8><h8a>'. $row['ticketName'] .'</h8a></td><br>
<td><h4><strong>Begin verkoop:</strong> ',date("d.m.Y", strtotime ($row['ticketSDate'])),' ', date('H:i', strtotime ($row['ticketSTime'])).' hr.<h4></td>
<td><h4><strong>Einde verkoop:</strong> ',date("d.m.Y", strtotime ($row['ticketEDate'])),' ', date('H:i', strtotime ($row['ticketETime'])).' hr.<h4></td>
<td><h5><strong>Beschrijving:</strong></color> '. $row['ticketDescription'] .'</h5></td>
<td><h4><strong>Event ID:</strong> '. $row['eventID'] .' '. $row['eventName'] .'</h4></td>
<form action="registratie.php" method="get">
<td><h4>'. $row['ticketID'] .' <input name="book" type="submit" value="Kies dit ticket" />
<input type="hidden" name="ticketID" value="'.$row['ticketID'].'">
</form>
<br><br>
</tr>';
}
}
?>
正確的,我忽略了這一個!謝謝,本尼 – Benny