• 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

XAMPP/SQLSRV: Unable to find Sqlsrv in PHPINFO(); - errors coming from connection

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

Laravel Factory not calling callback 'afterCreating'

How to get the survey List from surveygizmo API in the Postman?(Trial Version)

Adding hreflang tags automatically in WordPress subdirectory multisite

WHM Enabling mod_rewrite

Explain how this array transposing and flattening function works

How to programmatically find public properties of a class from inside one of it's methods

Getting public posts of a random user from Facebook API

How to get total pages of PDF with FPDF?

I want to use codeigniter foreign character library in my custom PHP project how i can use it?

How to insert Google Adsense Code in PHP script?

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'posts.post' doesn't exist

Display a product custom field only in WooCommerce Admin single orders

Laravel Command Schedule Not Working Properly

About Contact Privacy policy Terms and conditions