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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:13:30+00:00 2026-06-17T20:13:30+00:00

I am working on the Drupal CMS, where i am parsing a file &

  • 0

I am working on the Drupal CMS, where i am parsing a file & storing the data in DB.

So if there are more than 440 records (rows) in the file, it does not save it further. It works for the rows less than 440. It is an strange issue.

          $query = db_insert('table_name')->fields(array('field1', 'field2', 'field3'));

          $row = 1;
                while (($data = fgetcsv($handle, 0, ",")) !== FALSE)
                {
                    $num = count($data);

                    if ($row > 1) {

                        $query->values(
                            array(
                                'fields1' => $data[0],
                                'fields2' => $data[2],
                                'fields3' => $data[4] 
                            )); 

                        if($row == '440'){
                            break;
                        }
                    }
                    $row++;
                }


                $query->execute();

/////
if($row == ‘440’){
break;
}

Is added to check how many rows it saves.. If i increase the 440 to 460, it doesn’t save records to DB.

  • 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-17T20:13:31+00:00Added an answer on June 17, 2026 at 8:13 pm
    if($row == '440'){
      break;
    }
    

    Remove this block and it’ll be just fine.

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

Sidebar

Related Questions

I'm working in Drupal 6 with CCK. Under each text field there is a
Working on a project where we have a Drupal 5 set-up. There are currently
I've got Drupal working on a shared host, and I uploaded some modules from
I am working on Drupal. I want to know how to change that footer
After only a few weeks of working with Drupal I've come up with a
I'm working on a Drupal 5.x book-selling site and using the Views Fast Search
I'm working on a Drupal mobile site which is powered by the Mobile module.
I am working with a Drupal theme, and I see a lot of variables
I have Drupal 7 site which is working fine. I added a custom PHP
I am working on files in drupal. i use local wamp server with drupal6.

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.