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 8886915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:40:33+00:00 2026-06-14T21:40:33+00:00

In an MVC application, I have an array of arrays(rows) being sent to the

  • 0

In an MVC application, I have an array of arrays(rows) being sent to the controller from the view. All rows from the array will represent a row in the database.

I’m stuck at the point where:
– I can define a function, that accepts the array of all rows, in the model and loop the rows there.
– Or I can define a function that accepts a single row, and call it in a loop in the controller.

Which method is the right(from a MVC point of view) one?

EDIT:
The question is should I do:
$model->insertData($arrayOfRows);
or
foreach($arrayOfRows as $row) {
$model->insertRow($row);
}

  • 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-06-14T21:40:36+00:00Added an answer on June 14, 2026 at 9:40 pm

    So I ended up using the first solution:
    $model->insertData($arrayOfRows);
    and loop the array of rows inside the model.

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

Sidebar

Related Questions

In my MVC application I have a problem with passing data from view to
I have a MVC application which returns 2 types of Json responses from 2
in my MVC application I have a controller (ProjectController) which has an action (create).
In my MVC application I have a default route defined: routes.MapRoute( Default, // Route
In my ASP .NET MVC application i have a link that refreshes the preview
I have one question; In my ASP.NET MVC web application have to do certain
I have MVC application configured to use Forms Authentication. I'm signing out users by
I have a spring mvc application that I have broken up into separate maven
I'm developing an MVC application and I have a routine that gets the currently
I have a ASP.NET MVC application and I have a few entries on the

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.