php mysql table creation advice WHERE certain cell = -


i have table (parts) has 2 columns in it, 1000 or rows. 1st (parts) column has info stored in each row of it. updating 2nd column via csv files parsing php. csv file has 2 columns , half many rows. first column in updating csv file need match row in first column of parts table. 2nd column in csv file update 2nd column in (parts) table.

im using query loop info 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]."' parts_column1='".$values[0]."'"); } mysql_close($con); fclose($file); ?> 

in doing takes long, , script never finishes. if in small bits @ time works.

could advice speed up, , info why might stalling has been when process whole thing @ once?

take @ max_execution_time. can override ini setting set_time_limit. guessing script timing out.

as structure of code, there isn't wrong, per se. it's taking long according server's max_execution_time setting.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -