<?php
require 'db.php';
$orders = R::dispense('orders');
$orders->new_order = $_SESSION['logged_user'];
$orders->products = $_SESSION['product_ids'];
R::store($orders);
?>/**
* Short hand function to store a set of beans at once, IDs will be
* returned as an array. For information please consult the R::store()
* function.
* A loop saver.
*
* @param array $beans list of beans to be stored
*
* @return array
*/
public static function storeAll( $beans )
{
$ids = array();
foreach ( $beans as $bean ) {
$ids[] = self::store( $bean );
}
return $ids;
}$orders = R::dispense('orders', count($_SESSION['product_ids'] ));
$user = $_SESSION['logged_user'];
$cnt = 0;
foreach($_SESSION['product_ids'] as $product_id) {
$orders[$cnt]->new_order = $user;
$orders[$cnt]->products = $product_id;
}serialize implode?
Вам конечно виднее, как нужно для вашего проекта