In this case, I think increasing Timeout time is not a good option.
If the problem is the INSERT number, instead of making 34,000 you can make one just like this:
INSERT INTO example
(example_id, name, value, other_value)
VALUES
(100, 'Name 1', 'Value 1', 'Other 1'),
(101, 'Name 2', 'Value 2', 'Other 2'),
(102, 'Name 3', 'Value 3', 'Other 3'),
(103, 'Name 4', 'Value 4', 'Other 4');
Also, need to know why you need to do 34,000 INSERT... If and to solve a DUMP type problem, you can use SQL directly without using PHP.
To respond in Otto’s comment, saying that he uses store_procedure,
that:
for ($test=0; $test<10; $test++)
{
$str = "";
for ($w=0; $w < 3400; $w++)
{
$str .= "(".$w.",'Name1','Totpo','Name2'),\n";
}
$str .= "(".$w.",'Name1','Totpo','Name2');";
$query_insert = "
INSERT INTO EXEMPLE
(champ1,champ2,champ3,champ4)
VALUES ".$str;
//echo $query_insert;
$result = sql_query($db_so36,$query_insert);
}
then, 34,000 INSERT, it only takes 0.271 sec !
Any error is returned ? Where is the code ?
– gmsantos
does not generate any error simply to request the download of the file, so I understood the browser simply for execution. but the execution in the bank processes until the end
– Otto
We can assume that XPTO.php is some third party library and you have already taken proper precautions regarding the time limit?
– Bruno Augusto
no worse than it is not the file that does the whole procedure and yes we take care with respect to the time limit
– Otto
Show us the code :)
– gmsantos
I really can’t do this, first of all because it’s something from a very large company. second is something around 4500 lines, but runs until the end only I have this calculation procedure on a basis of 3600000 records generating only 35000 records and making the same Insert in another table
– Otto
Since you cannot share the code, try sharing the contents of the XPTO.php file (which would be the equivalent of the error) and/or the response HTTP headers (which would be to see why the browser decided to download the file instead of showing on the screen).
– Eitch