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 Link to comment https://forums.phpfreaks.com/topic/184588-inserting-100x-and-100y-coordinates-in-mysql-table-easy-way/ Share on other sites More sharing options...
blueman378 Posted December 10, 2009 Share Posted December 10, 2009 where are you getting your data from? Link to comment https://forums.phpfreaks.com/topic/184588-inserting-100x-and-100y-coordinates-in-mysql-table-easy-way/#findComment-974643 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);"); } } Link to comment https://forums.phpfreaks.com/topic/184588-inserting-100x-and-100y-coordinates-in-mysql-table-easy-way/#findComment-974652 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.