I'm on PHP JSON query with database.
$qAdzanIqomah = mysqli_query($con, "SELECT * FROM tb_sholat WHERE active = 'Y'");
while($dAdzanIqomah = mysqli_fetch_array($qAdzanIqomah))
{
$sholatName[] = $dAdzanIqomah['sholat_name'];
$audio_before_adzan[] = $dAdzanIqomah['audio_before_adzan'];
$iq = $dAdzanIqomah['iqamah'];
echo $iqamahC[] = date("H:i:s", strtotime("+ '" . $iq . "' minutes"));
}
$data = array(
'iqamah' => $iqamahC
);
echo json_encode($data);
The problem is, all the result is same even on table data is variations.
Result echo $iqamaC[]:
{"iqamah":["01:00:00","01:00:00","01:00:00","01:00:00","01:00:00"]}
-
01:00:00
01:00:00
01:00:00
01:00:00
01:00:00
Result echo $iq:
11
12
17
13
10
Is there something wrong with that code?