Berhitung dengan menggunakan PHP dan database mySQL,
ada tiga cara dalam video ini
1. yang pertama adalah count
$hitung_jumlah = mysqli_fetch_array(mysqli_query($konek,"select count(1) FROM tabel1 WHERE kode='kd1' "))[0];
2. dengan menggunakan while
$jumlah1 =0;
$jumlah_1 = mysqli_query($konek,"SELECT * FROM tabel1 WHERE kode='kd1' ");
while ($tabelA = mysqli_fetch_array ($jumlah_1)) {
$dataA =$tabelA ['nominal'];
{
$jumlah1=$jumlah1+$dataA ;
}}
3. dengan menggunakn SUM
$jumlah2 =mysqli_fetch_assoc(mysqli_query($konek,"SELECT SUM(nominal) AS total FROM tabel1 WHERE kode='kd1' "))["total"];
#informatika
#pemrogramman
#php
#html
#mysql
#zalfaz
https://zalfaz.com/...
https://www.youtube.com/watch?v=rr7q3W36rCE