• 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 do I enable error reporting in Laravel?

Issue saving card for customer

how to display a view on laravel 8 and not have a 404 NOT FOUND page?

Target Individual Form Instance/Counter Inside A PHP While Loop

How to send parameters in soap request in php in __soapcall() function

How to Generate PDF invoice to XML format using mPDF

Convert date and time to Jalali in Laravel

xdebug 3 not working in ubuntu 20.04 with docker

PHP random string generator

Laravel Carbon throws error The format separator does not match

how to validate form data in codeigniter 4

How to test laravel controller method?

how to fix Service provider class not found when using repository?

find in set in laravel ? example

PHP Array split string and Integers

About Contact Privacy policy Terms and conditions