我正在为一群当地企业做一些志愿工作,在新冠疫情期间为弱势群体提供食物。
订单示例:
Order No | Customer Name | Address | Quantity | Item Name | Notes
===================================================
#1234 | Freda Smith |3 High St | 1 | Loaf Bread | Wholemeal
#1234 | Freda Smith |3 High St | 2 | 500ml Milk | Skimmed
#1234 | Freda Smith |3 High St | 1 | Tea | Eng. Breakfast
我需要将订单号 #1234 的所有详细信息打印到一张票上,如下所示:
#1234, Freda Smith, 3 High St
1 X Loaf Bread, Wholemeal
2 X 500ml Milk, skimmed
1 X Tea, Eng. Breakfast
我已经玩过CONCATandCONCAT_GROUP并试图通过将SELECTHTML 格式分离来找出答案,但无法得到我需要的东西。我很接近,但没有雪茄!
编辑:
SELECT IS: $sql = "SELECT id,
Order_Number,
Full_Name,
Address,
Time_To_Deliver,
CONCAT(Quantity, Item_Name, Notes)
FROM orders
CONCAT_GROUP BY Order_Number";
$users = $mysqli->query($sql);
while($user = $users->fetch_assoc()){
互换的青春