Hello,
I’m making a query like below, but I’m getting this error, what’s wrong here?
Occurs in columns with 0 values
How should I do?
$transmitter = $db->prepare("SELECT
transmitter.urun_id,
transmitter.urun_kac_u,
rack_kabin_u.u_kac
FROM transmitter
INNER JOIN rack_kabin_u ON transmitter.urun_kac_u = rack_kabin_u.id
WHERE urun_id=? ");
if(isset($_SESSION['transmitter'])){
// Transmitter ID and Quantity are available in this series.
$transmitter_array = json_decode($_SESSION['transmitter'], true);
foreach ($transmitter_array AS $id => $adet){
$transmitter->execute([$id]);
$transmitter_u = $transmitter->fetch(PDO::FETCH_ASSOC);
/*
The purpose here is to find the total required area
by taking how many "U" space this transmitter takes up in
the rack cabinet and multiplying the transmitter by amount.
But this gives error "$transmitter_u['u_kac']"
*/
$transmitter_topla += (($transmitter_u['u_kac']+0.50)*$adet);
}
}