I have joined two tables, customers and orders, on the customer id value. There are multiple entries in orders table with same customer id.
When I display the entries of orders table, each order is followed by the customer details. Instead, I want the customer details to be displayed once followed by all the orders with that customer's id.
How do I do that using PHP and MySQL?
I want the output to be like
Customer1_name
Item 1 Quantity
Item 2 Quantity
Customer2_name
Item1 Quantity
Item2 Quantity
But what I'm getting is
Customer1_name
item1 quantity
Customer1_name
item2 quantity
if he has ordered 2 items