Long insert query

I want to insert about 12500 lines into my database for a map for a game server. this is my script generates the query

sql = "INSERT INTO `legends`.`map` (`x`, `y`, `land`, `collision`, `impedance`, `effect`) VALUES "
for (y=0;y<ig.game.collisionMap.data.length;y++){
   for (x=0;x<ig.game.collisionMap.data[y].length;x++){
      if (x==0&&y==0){
         comma=""
      }else{
         comma=","
      }
      sql=sql+comma+"("+x*55+","+y*55+",'kesmai',"+ig.game.collisionMap.data[y][x]+","+ig.game.backgroundMaps[0].data[y][x]+", '0')";
   }
}
console.log(sql)

The output is y=86 x=145 My client side script has access to the data for the maps so I was just pasting the output to phpMyAdmin to run the query. The problem I hit (which I expected) was my php script can only run 30 seconds this is my error.

Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\apps\phpmyadmin3.4.10.1\libraries\session.inc.php on line 92

I am running a WAMP server and I tried to edit my php.ini file here

; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 0

; Maximum amount of time each script may spend parsing request data. It's a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
; long running scripts. 
; Note: This directive is hardcoded to -1 for the CLI SAPI
; Default Value: -1 (Unlimited)
; Development Value: 60 (60 seconds)
; Production Value: 60 (60 seconds)
; http://php.net/max-input-time
max_input_time = -1

no luck so far... Any suggestions on how to run a long query such as this>?

I was considering temporarily putting it in my server script which runs in node.js

I think what you're looking for is set_time_limit() http://php.net/manual/en/function.set-time-limit.php

But you should see if there's any way to improve the performance of the query itself.

You guys have some really great sugguestions that I wasn't able to get to work for my specific application. My solution was to execute the query from node.js sending the sql from my client to the server. Rather than using phpMyAdmin. I did try removing the time limit from my phpMyadmin script but it didn't work. I passed the query via websockets but it isn't required.