PHP如何显示mysql选择查询到表

时间:2015-01-17 13:09:39

标签: php mysql database select

如何向表格显示选择查询?我使用Dreamweaver。

以下是查询:

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|

1 个答案:

答案 0 :(得分:0)

$ query =" SELECT * FROM admin.order_queue&#34 ;;

    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

尝试这样的事情