我正在尝试使用MySQL数据库中的数据创建一个表。问题是代码会在页面开头生成16个换行符。
<?php
$host="localhost";
$userdb="root";
$passdb="";
$db="tabelle";
$connect = mysqli_connect($host, $userdb, $passdb)
or die (mysqli_error());
mysqli_select_db($connect, "tabelle");
$dropdown = mysqli_query($connect, "select team1, team2, spielid from spiele");
echo "<table>";
while ($dropdownarray = mysqli_fetch_array($dropdown)) {
echo "<tr><td><input type='radio' class='bet' name='".$dropdownarray['spielid']."' value='". strtoupper($dropdownarray['team1'])."'></td>";
echo "<td>".strtoupper($dropdownarray['team1'])."</td>";
echo "<td> vs </td>";
echo "<td><input type='radio' class='bet' name='".$dropdownarray['spielid']."' value='". strtoupper($dropdownarray['team2'])."'></td>";
echo "<td>".strtoupper($dropdownarray['team2'])."</td></tr><br>";
}
echo "</table>";
&GT;