2017-07-02 80 views
-2

我希望用戶能夠選擇的行列1,我的代碼的foreach形式中選擇

$sqlUitlezenRanksUitlezen = mysqli_query($conn, "SELECT * FROM `Ranks` ORDER BY `RankID`"); 
//$sqlDataRanksUitlezen = mysqli_fetch_assoc($sqlUitlezenAccountBewerken); 
foreach($sqlUitlezenRanksUitlezen AS $sqlUitlezenRanksUitlezenEach) { 
    echo '<option value="'.$sqlUitlezenRankEach['RankID'].'">'.$sqlUitlezenRankEach['RankNaam'].'</option>'; 
} 

但如果我這樣做,它不會顯示名次名稱。有誰知道如何解決這個問題?

+5

你永遠不取結果。任何基本的mysql教程都會涵蓋這一點。 –

+0

我如何獲取我的結果? –

+0

哦,我現在看到它,我的價值是不正確的 –

回答

0

試試這個: -

$sqlUitlezenRanksUitlezen = mysqli_query($conn, "SELECT * FROM `Ranks` ORDER BY `RankID`"); 
    $sqlDataRanksUitlezen = mysqli_fetch_assoc($sqlUitlezenAccountBewerken); 
    foreach($sqlDataRanksUitlezen AS $sqlUitlezenRanksUitlezenEach) { 
     echo '<option value="'.$sqlUitlezenRankEach['RankID'].'">'.$sqlUitlezenRankEach['RankNaam'].'</option>'; 
    }