Here is a simplified typical query for order details in a oscommerce type shopping cart query. Customers buying tickets.
order_sql="SELECT o.orders_id,op.orders_id, op.products_quantity
FROM orders.o and orders_products.op
WHERE o.orders_id=op.orders_id
ORDER by o.orders_id and op.products_name";
order_query=tep_db_query(order_sql);
If there was an order and in that order a product was purchased with a quantity of 3.
How can I list the product 3 times? rather than the one time in this query
I want a result like this listing each product relevant to its order quantity and adding another number to denote the next quantity:
ORDER ID PRODUCT NAME
Order ID: 1 - Ticket No 7 - (1)
Order ID: 1 - Ticket No 7 - (2)
Order ID: 1 - Ticket No 7 - (3)
Order ID: 2 - Ticket No 9 - (1)
Order ID: 3 - Ticket No 4 - (1)
Order ID: 3 - Ticket No 4 - (2)