# How to save a lot of lines at same time in data base with cakephp 3.8?

**URL:** <https://discourse.cakephp.org/t/how-to-save-a-lot-of-lines-at-same-time-in-data-base-with-cakephp-3-8/6786>\
**Category:** Need Help\
**Created:** [October 19, 2019, 4:37pm UTC](https://discourse.cakephp.org/t/how-to-save-a-lot-of-lines-at-same-time-in-data-base-with-cakephp-3-8/6786 "2019-10-19T16:37:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![saulimabr](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/saulimabr/32/1512_2.png) [@saulimabr](https://discourse.cakephp.org/u/saulimabr)\
**Post date:** [October 19, 2019, 4:37pm UTC](https://discourse.cakephp.org/t/how-to-save-a-lot-of-lines-at-same-time-in-data-base-with-cakephp-3-8/6786/1 "2019-10-19T16:37:35Z")

</div>

I have an app the control some processes in a school. Actualy I have a page to insert students grade one by one in each school subject, but I need to create a form to insert the grade of a entire school class at same time.  
How I can do this form and how to save it in cakephp 3.8?

---

<div class="post-metadata">

**Author:** ![Schlaefer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/schlaefer/32/1001_2.png) [@Schlaefer](https://discourse.cakephp.org/u/Schlaefer)\
**Post date:** [October 19, 2019, 7:06pm UTC](https://discourse.cakephp.org/t/how-to-save-a-lot-of-lines-at-same-time-in-data-base-with-cakephp-3-8/6786/2 "2019-10-19T19:06:44Z")

</div>

There’s `saveMany` if performance isn’t a issue [1](https://book.cakephp.org/3.0/en/orm/saving-data.html#saving-multiple-entities).

`updateAll` is efficient way to update many columns in one swoop [2](https://book.cakephp.org/3.0/en/orm/saving-data.html#bulk-updates). But from the top of my head it bypasses a lot of model hooks incl. validation (don’t quote me on that). At least I treat it that way. Read the documentation and use with care.

You could create a modelless form [3](https://book.cakephp.org/3.0/en/core-libraries/form.html), extract the request data and call those as appropriate.

---

<div class="post-metadata">

**Author:** ![saulimabr](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/saulimabr/32/1512_2.png) [@saulimabr](https://discourse.cakephp.org/u/saulimabr)\
**Post date:** [October 19, 2019, 8:52pm UTC](https://discourse.cakephp.org/t/how-to-save-a-lot-of-lines-at-same-time-in-data-base-with-cakephp-3-8/6786/3 "2019-10-19T20:52:26Z")

</div>

> [@Schlaefer](#):
>
> But from the top of my head it bypasses a lot of model hooks incl. validation (don’t quote me on that). At least I treat it that way. Read the documentation and use with care.

Thanks, I will try this…
