• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

insert multiple rows in a saveall in cakephp

phpcakephpcakephp-2.0cakephp-2.1


PHP Snippet 1:

array(
    'Date' => array(
        0 => array(
            'date' => '08/05/2013',
        ),
        1 => array(
            'date' => '09/05/2013',
        )
    ),
)

PHP Snippet 2:

foreach($items as $lineItem){

    $this->Invoice->create();

    $this->Invoice->save(array(
        'user_id'=>$property['User']['id'],
        'invoice_id'=>$invId['Invoices']['id'],
        'item_id'=>$lineItem['item_number'],    
        'quantity'=>$lineItem['quantity'],
        'price'=>$lineItem['mc_gross']
    );

}

Related Snippets

How to get unique slug to same post-title for other time too?

Star and Half Star Rating in Laravel

how to get value from array in laravel

woocommerce_wp_select options array from product attribute terms

api response laravel doesn't show

I'm trying to write a clean url for my website using the $_SERVER['REQUEST_URI'] in php

Elastic Beanstalk with Laravel Envoy

Wordpress how to get the post thumbnail inside a figure tag

How to upload mpdf file after generating to s3 bucket in php

LARAVEL: How to fetch id dynamically in a query builder?

laravel MVC execution flow

Error when uploading certain .png files "Interlace handling should be turned on when using png_read_image"

Change user role if checkout custom checkbox is checked in WooCommerce

how to pass row id in href of a tag in codeigniter controller?

Create tags in laravel post publishing

About Contact Privacy policy Terms and conditions