เราไม่แน่ใจว่ามันผิดพลาดยังไงเพราะโค้ดที่แล้วทำได้เหมือนกันแต่พอมาใส่กับโค้ดใหม่มันขึ้นแบบนี้
พอมีใครใจดีดูให้หน่อบมั้ยคะ ว่าเกิดจากอะไร
Full Code ค่ะ
<?php
//connect database and select information from database
include 'connect.php';
$sql = "select * from clientdata where name like '%{$_POST['itemname']}%'";
$query = mysqli_query($link, $sql);
?>
<!-- show table topics --> <!-- -->
<div class="tbl-header">
<table cellpadding="0" cellspacing="0" border="0">
<thead>
<tr>
<th style="width:4%" >No.</th>
<th style="width:23%;text-align:center;" >Nama Client</th>
<th style="width:23%;text-align:center;">Salinan No. IC</th>
<th style="width:23%;text-align:center;">Salinan Geran Tanah</th>
<th style="width:23%;text-align:center;">Download PDF</th>
</tr>
</thead>
</table>
</div>
<!-- show information from database while live search -->
<div class="tbl-content">
<table cellpadding="0" cellspacing="0" border="0" id="list-data">
<tbody>
<?php $i=1; while ($result = mysqli_fetch_assoc($query)) { ?> //เป็นตรงนี้
<tr>
<td style="width:4%;"><?php echo $bil;?></td>
<td style="width:23%; text-align:center;" ><?php echo $row['nama'];?></td>
<td style="width:23%; text-align:center;"><?php echo $row['snoic'];?></td>
<td style="width:23%; text-align:center;"><?php echo $row['sgran'];?></td>
<td style="width:23%; text-align:center;"><?php echo $row['sgran'];?></td>
</tr>
<?php $i++; } ?>
</tbody>
</table>
</div>
mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, แก้ยัไงได้บ้างคะ
พอมีใครใจดีดูให้หน่อบมั้ยคะ ว่าเกิดจากอะไร
Full Code ค่ะ
<?php
//connect database and select information from database
include 'connect.php';
$sql = "select * from clientdata where name like '%{$_POST['itemname']}%'";
$query = mysqli_query($link, $sql);
?>
<!-- show table topics --> <!-- -->
<div class="tbl-header">
<table cellpadding="0" cellspacing="0" border="0">
<thead>
<tr>
<th style="width:4%" >No.</th>
<th style="width:23%;text-align:center;" >Nama Client</th>
<th style="width:23%;text-align:center;">Salinan No. IC</th>
<th style="width:23%;text-align:center;">Salinan Geran Tanah</th>
<th style="width:23%;text-align:center;">Download PDF</th>
</tr>
</thead>
</table>
</div>
<!-- show information from database while live search -->
<div class="tbl-content">
<table cellpadding="0" cellspacing="0" border="0" id="list-data">
<tbody>
<?php $i=1; while ($result = mysqli_fetch_assoc($query)) { ?> //เป็นตรงนี้
<tr>
<td style="width:4%;"><?php echo $bil;?></td>
<td style="width:23%; text-align:center;" ><?php echo $row['nama'];?></td>
<td style="width:23%; text-align:center;"><?php echo $row['snoic'];?></td>
<td style="width:23%; text-align:center;"><?php echo $row['sgran'];?></td>
<td style="width:23%; text-align:center;"><?php echo $row['sgran'];?></td>
</tr>
<?php $i++; } ?>
</tbody>
</table>
</div>