I want to use time
as a category and I have this tables:
Table addonlist_final
Table addons
I want the output to be look like this:
Order at 11:17 am
Coke 1 Litre
Ham & Cheese Sandwich
Order at 11:15 am
Coke 1 Litre
Hotdog Sandwich
Tuna Sandwich
What I've currently done is this code, but only shows the first item
on the group.
<?php
$getaddons = mysql_query("SELECT a.addon_id, a.description, a.price, a.status, fl.faddon_id, fl.quantity, fl.timef
FROM addons AS a
LEFT JOIN addonlist_final AS fl ON a.addon_id = fl.faddon_id AND fl.ftransac_id = '96675'
GROUP BY fl.timef
LIMIT 10
");
while($rows = mysql_fetch_assoc($getaddons)){
$addonid = $rows['addon_id'];
$addondesc = $rows['description'];
$addonprice = $rows['price'];
$addonstat = $rows['status'];
$quantity = $rows['quantity'];
$timef = $rows['timef'];
$total = $addonprice * $quantity;
if($rows['faddon_id']){
echo "Ordered at $timef<br />";
echo "$addondesc<br />";
}
echo "<br />";
}
?>
Output:
Ordered at 11:15 am
Coke 1 Litre
Ordered at 11:17 am
Coke 1 Litre