I am attemping to calculate the cost by issuing the query below however it always return no value:
//Re-calculate the cost price
$f15 = "SELECT sum(cost) FROM ingredients WHERE item_id_fk = :targetID";
$e16 = $this->l1->prepare($f15);
$e16->bindParam(':targetID', $g4);
$e16->execute();
$g5 = $e16->fetch(PDO::FETCH_NUM);
error_log(print_r($g5[0], TRUE));
Did I miss out something? Your help is kindly appreciated.
Thank You.