i'm trying to count only the variable that fit the condition but the data i'm about to count is a result from formula and not inside the database here is the code
if (isset($_GET['tanggal'])) {
$tgl=trim($_GET['tanggal']);
$material=trim($_GET['material']);
$proyek=trim($_GET['proyek']);
$sql="SELECT *, count(ketebalan-(toleransi/10)) as mintebal FROM tb_coring, tb_coredrill WHERE tb_coring.kode_material='$material' and tb_coring.kode_proyek='$proyek' and tb_coredrill.kode_material='$material' and tb_coredrill.kode_proyek='$proyek' and tb_coring.tanggal_coring='$tgl' GROUP BY tanggal_coring";
}
$hasil=mysqli_query($db,$sql);
$no=0;
while ($data = mysqli_fetch_array($hasil)) {
?>
<tr>
<td>Jumlah Data : <?php echo $data['mintebal']; ?></td>
</tr>
<?php
}
example i have 10 if i only echo mintebal but it will echo 8 data that fit the condition or should i just add more column for the result of the formula on my database for easier count?