iwpg Posted August 7, 2008 Share Posted August 7, 2008 Hello. I have a several hundred records that are imported from a CSV file, and sorted out into an HTML form first. The form is then submitted into a MYSQL database. When submitting the form, I sometimes get a timeout. I was wondering what is the best approach to splitting the data to say 200 records at a time. Any help is appreciated. Link to comment https://forums.phpfreaks.com/topic/118552-timeout-on-php-form-upload/ Share on other sites More sharing options...
iwpg Posted August 7, 2008 Author Share Posted August 7, 2008 Please? Link to comment https://forums.phpfreaks.com/topic/118552-timeout-on-php-form-upload/#findComment-610900 Share on other sites More sharing options...
budimir Posted August 7, 2008 Share Posted August 7, 2008 Check you php.ini settings! Set this: max_execution_time = (like) 300000 Link to comment https://forums.phpfreaks.com/topic/118552-timeout-on-php-form-upload/#findComment-610921 Share on other sites More sharing options...
iwpg Posted August 7, 2008 Author Share Posted August 7, 2008 Thanks, I modifed php.ini to 90 seconds, and increased memory to 32M and rebooted. It still times out at around 30 seconds. Right now, I am adding around 1500 lines with 2 columns. I am thinking that the rows and columns is increasing processing time. I know how to Preg Split single entries per line, but cannot seem to get 2 columns in the database, to 2 fields. 1 row per entry. This is what I have now, and it seems to load much faster: Within a textarea form: Entry 1 Value 1 Entry 2 Value 2 Entry 3 Value 3 (and so on...) My code: //Split data $data = preg_split('/\r\n|\n/', $_POST['entry'], -1, PREG_SPLIT_NO_EMPTY); //Iterate through array foreach ($data as $entry) { mysql_query("insert into table (entry) values ('$entry')"); } Now I think that this is taking the Entry and Value array and combining them. I don't know how I can add "Value" as the corresponding Entry value. I am thinking about a comma delimeter, but I still would not know where to go with the code. Thank you so much. I've been working on the all day, and haven't had any luck. Link to comment https://forums.phpfreaks.com/topic/118552-timeout-on-php-form-upload/#findComment-611173 Share on other sites More sharing options...
Third_Degree Posted August 7, 2008 Share Posted August 7, 2008 try this at the top of your code: set_time_limit(0); Link to comment https://forums.phpfreaks.com/topic/118552-timeout-on-php-form-upload/#findComment-611179 Share on other sites More sharing options...
iwpg Posted August 8, 2008 Author Share Posted August 8, 2008 I still have the same problem even with the time override of php.ini. I see now that the form itself is timing out based on an impartial mysql upload on the data. I'm getting around 350-450 records in before it times out. Thanks, Mike Link to comment https://forums.phpfreaks.com/topic/118552-timeout-on-php-form-upload/#findComment-611400 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.