PHP’s implode() in MySQL
Thursday, November 12th, 2009Here is a quick tip, to get similar result as php’s array implode function inside of MySQL use GROUP_CONCAT() here is a quick example
SELECT store_orders.*,
(SELECT GROUP_CONCAT(item_name) FROM `store_orderitems` WHERE store_orders.id=store_orderitems.order_id) AS items_purchased
FROM `store_orders`