Delinda Dyta Delinda Dyta - 5 months ago 17
PHP Question

How to insert more than 1000 rows to Postgresql using PHP

Please anyone help me to solved my case :

What should I add to my code, if the output from the code below is insert on the table in POSTGRES, and row that will be inserted are more than 1000 rows. When I running using this code below it appears the error :

Fatal error: Maximum execution time of 60 seconds exceeded in D: \ xampp \ htdocs \ BillingDeliveryInfo \ page2.php on line 45

Because it took so long query maybe

while($msisdn = pg_fetch_row($qaccount)){
if ($msisdn[4]==2){
$insert1="insert into delin_bdi_rf
values ('$msisdn[1]',
'$m1[1] $msisdn[1] $m1[2] $msisdn[2] $m1[3] $msisdn[3] $m1[4]',
$insert2="insert into delin_bdi_rf
values ('$msisdn[1]',
'$m2[1] $msisdn[1] $m2[2] $msisdn[3] $m2[3]',


Try adding this in the beginning:

ini_set('max_execution_time', 300); //300 seconds = 5 minutes

It increases maximum execution time of script.