Good day all
Im working on a small project where i need to be able to send multiple values to the database.
Basicly the user can select as much "products" as they want and it needs to save the "products" to the database.
$i = 0;
foreach ($_POST['ItemID'] as $x => $y ) {
$order = itempurchased::create();
$order->warranty = "$warranty[$i]";
$order->itemID = "$itemID[$i]";
$order->amount = "$amount[$i]";
$order->LampType = "$LampType[$i]";
$order->ItemModel = "$ItemModel[$i]";
$order->TotalPP = "$TotalPP[$i]";
$order->FinalTotal = "$FinalTotal";
$order->ProductID = "$productID";
$order->write();
return $this->order;
$i++;
}
Any suggestions would help a lot
Thanks in advance
Edit: I Found my stupid mistake... i was not suppost to add the return $this->order;