• 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 can I create a Download Page with post php method?

Can we define variables in `.tpl` files?

How to render html from a @foreach loop in a textarea

Check if user online laravel

PHP my timezone is no setting up in PHP.ini File in xampp

How can I convert from a{a{} b{}} to a[a[],b[]] using php preg_match?

Render the content of default_filter.php in Joomla front-end

Upgrade PHP on AWS Linux

Transfer data between JavaScript and PHP through JSON

Get Header Authorization value of a login api (sent with username and password in json body) using php curl

Symfony - EasyAdmin - Add and remove functions are ignored from AssociationField

Form repeater send wrong data with last element in Laravel

Do I need to install `fxp/composer-asset-plugin` if I'm not doing front-end development

How to convert the int value to inch in PHP [closed]

How should I get started using PHPUnit as a testing framework for a bunch of functions and classes I have already made?

About Contact Privacy policy Terms and conditions