Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7699753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:33:10+00:00 2026-05-31T22:33:10+00:00

Is batch insertion of records possible in cakephp ? Kindly reply me if possible

  • 0

Is batch insertion of records possible in cakephp ?

Kindly reply me if possible show me some samples ?

My Query will look like

INSERT INTO `job_places` (`id`, `country_code`, `group`, `name`) VALUES
 (1, 'DE', 3, 'Hamburg'),
 (6, 'FFF', 1, 'Frankfurt');
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:33:11+00:00Added an answer on May 31, 2026 at 10:33 pm

    You have saveAll for things like this http://book.cakephp.org/1.3/view/1031/Saving-Your-Data

    Used to save (a) multiple individual records for a single model or (b) this record, as well as all associated records
    For saving multiple records of single model, $data needs to be a
    numerically indexed array of records like this:

    Array (
    
    >     [Article] => Array(
    >           [0] => Array
    >               (
    >                             [title] => title 1
    >                         )
    >           [1] => Array
    >               (
    >                             [title] => title 2
    >                         )
    >                 ) )
    

    In your example, you’ll need to format your data array like:

    $data = array(
       'Job' => array(
          array('id' => 1, 'country_code' => 'DE', 'group' => 3, 'name' => 'Hamburg'),
          array('id' => 6, 'country_code' => 'FFF', 'group' => 1, 'name' => 'Frankfurt')
       )
    );
    
    $this->JobPlace->saveAll($data['Job']);
    

    Nothing beats trying when you are learning something, so give that a go and post any problems you are having rather than wait for someone to post the exact code where you can just copy paste.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The batch file is something like this, I put the python in some directory
All that I will do is insert records into the database. However, I would
I've wrote some code to batch delete/insert sections and cells from/into a table view.
I'm doing some work that involves inserting a batch of records into a Sql
I am doing batch insert for inserting 80k records and 1200 records per batch.
Some batch files on Windows use an IF syntax with multiple lines, as below:
I would like a batch file to launch two separate programs then have the
So I have a UITableView in which I am doing batch insert/delete/reloads into. Every
I'm using batch insertion of nodes and relationships into Neo4j graph database. Everything works,
I am using STS + Grails 1.3.7 and doing the batch insertion for thousands

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.