Hi, i’m not getting 0 as a result, where there is no value of qty*ctnqty, it’s only giving me the value of qty*ctnqty, where there have some value.
Please help!
$detailships = "SELECT COALESCE(SUM(qty*ctnqty),0) AS total
FROM freddyshipment
WHERE kcgmt='$posrefno'
AND style='$postyle'
AND orderno='$posorderno'
AND col='$poscol'
AND sizes='$posize'
GROUP BY kcgmt,style,orderno,col,sizes";
}
$details_resultships = mysqli_query($conn,$detailships)
or die ( "Couldn't get Products: ".mysqli_error($conn) );
while ( $new_row = mysqli_fetch_array ( $details_resultships ) )
{
echo "<td class=count-me>".$new_row[ 'total' ]."</td>";
}