foreach($query_result as $q) {
$order_id = $q['order_id']
$orders = implode('||', $q['orders'])
foreach ($orders as $order){
$order_data = implode (',', $order)
$order_data[0] - это PRICE
$order_data[1] - это DATE_INSERT
$order_data[2] - это NAME
и тд
}
}
WHERE p.god_potr = '2012'
AND p.mes IN (6,7,8)