我只是想,讓我查看我的數據庫...... 行列表中選擇一個表,但我的代碼將無法正常工作, 這裏是我的全部代碼:如何通過表查看數據庫上的行?
$con=mysqli_connect("fd***.biz.nf","1549087_admin","*****","******");
$sql = "SELECT * FROM Solo;";
$myData = mysqli_query($con,$sql);
echo "<table border='1'>
<tr>
<th>Grade/Yr. Level</th>
<th>First Name</th>
<th>Middle Name</th>
<th>Last Name</th>
<th>Age</th>
<th>Position</th>
<th>Motto</th>
</tr>";
while($row = mysqli_fetch_array($myData, MYSQLI_ASSOC))
{
echo "<tr><td>";
echo $row['gradeyrlevel'];
echo "</tr><td>";
echo $row['firstname'];
echo "</tr><td>";
echo $row['middlename'];
echo "</tr><td>";
echo $row['lastname'];
echo "</tr><td>";
echo $row['age'];
echo "</tr><td>";
echo $row['position'];
echo "</tr><td>";
echo $row['motto'];
echo "</tr><td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);
請幫助我。
的錯誤是:
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /srv/disk10/1549087/www/rooseveltcollegecainta.co.nf/admin/adminpage/index.php on line 125
線125
while($row = mysqli_fetch_array($myData, MYSQLI_ASSOC))
這是什麼意思「不工作」?你檢索哪個錯誤? –
更多細節將是有益的。什麼不工作? –
這是錯誤出現了: 警告:mysqli_fetch_array()預計參數1被mysqli_result,在給定的/srv/disk10/1549087/www/rooseveltcollegecainta.co.nf/admin/adminpage/index.php在線路125 – user3026685