I am a beginner to PHP. I am trying to insert large amount of items into database. I am using for
loop and mysqli_query
commands.
My pseudo-code is something like this:
for ($i=0; $i<50000; $i++) {
mysqli_query($con, "INSERT INTO users (name, age) VALUES ('$name','$age'); ") ;
}
I have my code working a few hundred loops and then poof: Fatal error: Maximum execution time of 30 seconds exceeded in xxx on line xxx
For me, only solution is to manually increment my counter every time after loop breaks.
Is there any other solution? Please, help!