So, I am trying to insert 250,000 rows into my database. Since these are just data samples, I just need to request the x, y variable, which changes, therefore, for loops and just the landscape, which is just “water”
But this happens forever. Does anyone know how I can do this faster?
ini_set('max_execution_time', 70000);
$conn = mysql_connect('localhost', 'root', '') or die(mysql_error());
mysql_select_db('hol', $conn) or die(mysql_error());
for ($y=0;$y<500;$y++) {
for ($x=0;$x<500;$x++) {
mysql_query("INSERT INTO map(x, y, terrain) VALUES($x, $y, 'water')");
}
}
source
share