警告:mysqli_query()預計參數1是mysqli的,給定的字符串在 C:\ XAMPP \ htdocs中\ tutoringEnrollmentList.php第45行上具有這2個錯誤試圖在PHP顯示MySQL數據
警告:mysqli_fetch_array()預計參數1被mysqli_result, 空在C中給出:\ XAMPP \ htdocs中\ tutoringEnrollmentList.php線60上
這裏是線41-78
<?php
$dbc = mysqli_connect ('localhost', 'root', '', 'studentDB')
or die (mysqli_connect_error());
$sql = "SELECT * FROM `tutoringservice`";
$data = mysqli_query($sql, $dbc);
echo "<table border=1>
<tr>
<td> # </td>
<td> Date </td>
<td> Last Name </td>
<td> First Name </td>
<td> Email </td>
<td> Student ID </td>
<td> Subject </td>
<td> Message </td>
<td> Tutoring Day </td>
</tr>";
while($record = mysqli_fetch_array($data)){
echo "<tr>";
echo "<td>" . $record['#'] . "</td>";
echo "<td>" . $record['Date'] . "</td>";
echo "<td>" . $record['Last Name'] . "</td>";
echo "<td>" . $record['First Name'] . "</td>";
echo "<td>" . $record['Email'] . "</td>";
echo "<td>" . $record['Student ID'] . "</td>";
echo "<td>" . $record['Subject'] . "</td>";
echo "<td>" . $record['Message'] . "</td>";
echo "<td>" . $record['Tutoring Day'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($dbc);
?>