Hi...
I have table with
PO_No
POReq
CompKg
PlugWt
Doz
KgDoz
TotalKg
BatchNeeded
Now,
I have problem in updating field (Doz, KgDoz, TotalKg, BatchNeeded).
here is my code:
the result are wrong.PHP Code:$sql = "SELECT CompKg, PlugWt, POReq FROM sales_order ";
$res = mysql_query($sql, $con);
while($row = mysql_fetch_assoc($res)){
$CompKg = $row['CompKg'];
$PlugWt = $row['PlugWt'];
$POReq = $row['POReq'];
$Doz = (($CompKg * 1000) / $PlugWt) / 12 / 2;
$KgDoz = ($CompKg / $Doz);
$TotalKg = ($POReq * $KgDoz);
$BatchNeeded = ($POReq / $Doz);
}
$sqlupdate = "UPDATE sales_order SET
Doz = '$Doz',
KgDoz = '$KgDoz',
TotalKg = '$TotalKg',
BatchNeeded = '$BatchNeeded'";
$res_update = mysql_query($sqlupdate, $con);
Thank you


Reply With Quote
Bookmarks