私はテーブルを持っています
EVENTCODE EVENTNAME VENUE DATE ACTION
001 Concert Here 09/13 Reserve Now
002 Sports Here 09/12 Reserve Now
[今すぐ予約] をクリックすると、フォームがポップアップ表示されます。
EVENTNAME: ------ (fetch)
VENUE: --------- (fetch)
DATE: ------ (fetch)
Full Name: ---- (user input)
Contact No.: ----- (user input)
Email: ----- (user input)
[SUBMIT BUTTON]
私の質問は、データベースから特定のデータを独立して表示するにはどうすればよいですか? 最初のエントリ (EVENTCODE 001) で [今すぐ予約] をクリックすると、最初のエントリの EVENTNAME、VENUE、DATE がフォームに反映されますか? トランザクションのような別のテーブルとして記録できるように、その「リフレクション」をどのようにフェッチしますか?
これの疑似コードやロジックが思いつかないので、本当にイライラしています。助けてください。ありがとう!
ここに私のコードがあります:
<?php
if(mysqli_num_rows($qr)==0){
echo ("No record fetched...<br>");
}//end no record
else{//there is/are record(s)
?>
<div class="scroll" style="height:200px; overflow:scroll;" >
<table width="100%" border="1" class="altrowstable" id="alternatecolor">
<tr align="center">
<th>Name</th>
<th>Venue</th>
<th>Date & Time</th>
<th> </th>
</tr>
<?php
while ($record=mysqli_fetch_array($qr)){//redo to other records
?>
<tr>
<td><?php echo $record['name']; ?></td>
<td><?php echo $record['venue']; ?></td>
<td><?php echo $record['date']; ?></td>
<td><a href="reservemain.php" target="reserve">Reserve Now!</a></td>
</tr>
<?php
}//end of while
?>