I understand why this is due to the type of connection INNER
it will help you understand.
, 1 . , p.ProductionOrderID = b.BatchID
, , , , , , . , , - , . , , .
HTML, while
foreach
, SQL
, . EX: $row["BatchQTY"]
.
if ( $result = $mysqli->query("
SELECT *
FROM ProductionOrder AS p
LEFT JOIN ProductionOrderStatus AS s ON ( p.ProductionOrderID = s.ProductionOrderStatusID )
LEFT JOIN NotGood AS n ON ( p.ProductionOrderID = n.NGID )
LEFT JOIN BatchOrder AS b ON ( p.ProductionOrderID = b.ProductionOrderID)//Changed this equation
LEFT JOIN Brand AS bd ON ( p.ProductionOrderID = bd.BrandID )
LEFT JOIN CustomerOrder AS co ON ( p.ProductionOrderID = co.COID )
LEFT JOIN Customer AS c ON ( p.ProductionOrderID = c.CustomerID )
LEFT JOIN CustomerOrderStatus AS cos ON ( p.ProductionOrderID = cos.COStatusID )
WHERE p.ProductionOrderID='$OrderId'")