您可能想要使用特殊查詢從團隊中獲得摔跤手。然後使用while循環來更新數組中所有摔跤手。然後將該數組分配給來自數據庫的特殊索引編號。你可以在數據庫中顯示什麼?我需要知道爲了幫助。因爲我不知道你的數據庫中有什麼。我只是猜測你的數據庫是如何組織的。假設你的球隊下拉列表叫做team_select,而摔跤手錶中的每個摔跤手都有一個wrestler_id wrestler_name和一個team_id。
你會做下面的代碼
$team_select = $_POST['team_select']
$wrestler_query = "SELECT wrestler_name FROM wrestler WHERE team_id = "
. $team_select;
$query = mysqli_query($connection, $wrestler_query);
//Repeat code from here... (see bottom)
while($team_select = mysqli_fetch_assoc($query));
{
echo '<option class="Select1" value="' . $team_select['wrestler_name'] . '">'</option>
}
<?
</select>
<?php
mysqli_data_seek($accounts,0);
//..to here for other drop down lists (except give the different names of different drop down lists in the html.)
另外不要忘了,連接變量是數據庫訪問權限。
獲勝者總是得分最高的球隊嗎?如果是這樣,你爲什麼需要一個領域來選擇贏家?你已經知道誰通過檢查得分而獲勝。 – AllInOne
你可以在數據庫中顯示什麼? – DrinkJavaCodeJava
感謝您的回覆。這是我的表單代碼的示例。 http://jsfiddle.net/gDMvU/ – ewk53