I have made a view mysql and php I want to display the operation through the filter, but the result could not be displayed. Here is the code this function to show data
function tampilDataRegFilter($data){
$query=mysql_query("SELECT * from dataPendaftaran WHERE nm_mhs LIKE '%$data%'");
$no_rows=mysql_num_rows($query);
if($no_rows==1){
while($row=mysql_fetch_array($query)){
$data[]=$row;
return $data;
}
}
}
here to show data
<?php
//tampil berdasar filter
if($_POST['do']=="find"){
$arrayBayarReg=$data->tampilDataRegFilter($_POST['q']);
}
if(count($arrayBayarReg)){
foreach($arrayBayarReg as $data){
?>
<tr class="tabcont">
<td class="tabtxt" align="center"><?php echo $c=$c+1; ?>.</td>
<td class="tabtxt" align="center"><?php echo $data['kode_bayar'];?></td>
<td class="tabtxt" align="center"><?php echo $data['nm_mhs'];?></td>
<td class="tabtxt" align="center"><?php echo $data['tgl_bayar']; ?></td>
<td class="tabtxt" align="center"><?php echo $data['jumlah']; ?></td>
<td class="tabtxt" align="center"><?php echo $data['keterangan']; ?></td>
</tr>
<?php
}
}else{
echo 'Not Found !';
}
?>
How to solve this, i'm beginner in php. Thanks so much for helping :)