警告:mysqli_fetch_array()預計參數1被mysqli_result,串給出錯誤mysqli_fetch_array()預計參數1被mysqli_result,串給出
這是我的代碼誰能告訴我什麼是錯?
$result ="SELECT * FROM report" ;
if(mysqli_query($cons, $result)) {
echo("
<div class='sc'>
<table id='to1' width='90%' border='0' cellspaceing='1' cellpadding='8' align='center'>
<tr bgcolor='#9B7272'>
<td > ID </td>
<td > first_name </td>
<td > last_name </td>
<td > phone </td>
<td > address </td>
<td > email </td>
<td > birthdate </td>
<td > gender </td>
<td > city </td>
<td > dr_name </td>
</tr>
");
while($row = mysqli_fetch_array($result))
{
$ID =$row['ID'];
$first_name =$row['first_name'];
$last_name =$row['last_name'];
$phone =$row['phone'];
$address =$row['address'];
$email =$row['email'];
$birthdate =$row['birthdate'];
$gender =$row['gender'];
$city =$row['city'];
$dr_name =$row['dr_name'];
echo " <tr bgcolor='#C7B8B8'>
你應該通過the_result_ mysqli_query的'()''到mysqli_fetch_array()',而不是查詢本身... – Sirko