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

  • Home
  • SEARCH
  • 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 3985100
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:50:58+00:00 2026-05-20T05:50:58+00:00

I have a table (parts) that has 2 columns in it, 1000 or so

  • 0

I have a table (parts) that has 2 columns in it, 1000 or so rows. The 1st (parts) column has info stored in each row of it. I am updating the 2nd column via a csv files that I am parsing with PHP. That csv file has 2 columns and about half as many rows. The first column in the updating csv file will need to match the row in the first column of the parts table. Then the 2nd column in the csv file will update the 2nd column in the (parts) table.

Im using this query to loop the info into the parts table:

<?php
$file = fopen("csv-file-w-2-columns.csv","r");
require "../db_connect.php";
mysql_select_db("parts", $con);
while(!feof($file)) {
    $line = fgets($file);
    $values = explode(",",$line);
    mysql_query("UPDATE parts SET parts_column2='".$values[1]."' WHERE parts_column1='".$values[0]."'");
}
mysql_close($con);
fclose($file);
?>

In doing this is takes to long, and my script never finishes. If I do this in small bits at a time it works.

Could anyone help with some advice to speed this up, and any info to why it might be stalling like it has been when I process the whole thing at once?

  • 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-20T05:50:58+00:00Added an answer on May 20, 2026 at 5:50 am

    Take a look at your max_execution_time. You can override this INI setting with set_time_limit. I am guessing that your script is timing out.

    As for the structure of your code, there isn’t really anything wrong, per se. It’s just taking too long according to the server’s max_execution_time setting.

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

Sidebar

Related Questions

I have a table that has the following columns: GRVLID GRID Timein Timeout This
I have a table called excel that has 3 columns, name , id ,
I have a table that has (for example) 4 columns. pk_table_id INT NOT NULL
I have a table that has the following columns table: route columns: id, location,
I have table with around 70 000 rows. There is 6000 rows that i
I have a table called trends_points , this table has the following columns: id
I have a table that has worked correctly for many years, but recently the
I have to maintain an application that has a lot of columns that are
Say I have a mysql table of names and one column has the following
I have a temporary table that contains a part category and the associated part

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.