2015-01-17 50 views
0

如何顯示選擇查詢到表?我使用Dreamweaver。PHP如何顯示mysql選擇查詢到表

這裏的查詢:

SELECT date(Date) as Monthly, sum(qtyBlackWhite) as TotalBW, sum(qtyChocnut) as TotalChocnut, 
       sum(qtyHotMama) as TotalHotMama,sum(qtyMocha) as TotalMocha, 
       sum(qtyUbeKeso) as TotalUbeKeso 
FROM admin.order_queue 
GROUP BY month(Date); 

在表中的列應

|Monthly|TotalBW|TotalChocnut|TotalHotMama|TotalMocha|TotalUbeKeso| 
+0

什麼是你的PHP代碼? – henje

+0

谷歌無法正常工作? – Strawberry

+0

@henje還沒有。不知道如何。 – MarkTu

回答

0

$查詢= 「SELECT * FROM admin.order_queue」;

if($display = mysql_query($query2) or die("Error in Selecting : ".mysql_error())) 
     echo("Success in Selecting <br/>"); //executing SELECT query 


    while($row = mysql_fetch_array($display)) 
    { 
     print($row['Monthly']); 
     print(" | "); 
     print($row['TotalBW']); 
     print(" | "); 
     ... 

    } // Displaying the SELECT query 

嘗試這樣的事情