slyte33 Posted December 10, 2009 Share Posted December 10, 2009 Is there a way to insert this data into a mysql table named 'map' with the fields: 'x int 3' , 'y int 3' in an easy way with maybe a for loop or something? I want the data entered to be like this: 0x 0y 1x, 0y 2x,0y 3x,0y all the way up to 100x and 100y. All feedback appreciated, thanks Quote Link to comment Share on other sites More sharing options...
blueman378 Posted December 10, 2009 Share Posted December 10, 2009 where are you getting your data from? Quote Link to comment Share on other sites More sharing options...
trq Posted December 10, 2009 Share Posted December 10, 2009 You could, but it might hurt a little. for ($x=0; $x<=100;$x++) { for ($y=0;$y<=100;$y++) { mysql_query("INSERT INTO map(x,y) VALUES ($x,$y);"); } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.