我只是想,让我查看我的数据库...... 行列表中选择一个表,但我的代码将无法正常工作, 这里是我的全部代码:如何通过表查看数据库上的行?
$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