while($pro=mysql_fetch_array($query)) {
แทรกตรงนี้เลยครับ $ms = mysql_query("select sum(Qty) as count from cart where ProductID ='".$pro['ProductID'."'");
Select a.ProductID,a.ProductName,a.ProductAmount,sum(isnull(b.qty,0)) as count
from product a
left outer join cart
on a.ProductID = b.ProductID
group by a.ProductID,a.ProductName,a.ProductAmount