I have a database table called orders_products that includes three columns called products_model, products_quantity,orders_id
There may be one or several items with the same orders_id that I need to create a string from. I would need to query by the orders_id and return all matching records in a string like the below example.
Ordered products: format is "q1#model1|q2#model2|..." where q1 is the quantity for the product with the model1. Use | to separate any number of products.
Example:"1#itema|2#itemb|1#itemc|5#itemd"
I am fairly new at this and can figure out how to get 1 record but an order can have multiple products. Inserting the divider is also driving me crazy because it only goes between and not before or after..
Any help is appreciated
Steve