cooldude832 Posted July 18, 2007 Share Posted July 18, 2007 I'm generating a dynamic map off mysql and it will be a sort of 10x10 grid that is composed of different images (like grass, trees, sand, mountains, lake etc etc) My question is would it be better to use the gd library to generate each map look (it changes on every page load) using GD to link each of the smaller images (48x40 pngs) to 1 big (480x400) png and then only displaying that one image. Or would it be better to just query out and display them straight from the query doing it 100 times (10 by 10 grid) showing 100 images. Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted July 18, 2007 Share Posted July 18, 2007 Well...100 queries is a lot, especially if this page is going to be viewed a lot, so I would try to avoid that route if possible. If you can make it happen with the GD library, then I say go with that. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 18, 2007 Author Share Posted July 18, 2007 its not 100 queries the query is the same in both case $q = "select x,y,type from `map` where x>=$minx && $x <=$maxx && y>=$miny && y<$maxy"; but then after it is queried it has a while loop while ($row = mysql_fetch_assoc($result){ Options here. I can paste together the whole map if i sort my query by Y then X and then simply "grow" the big image out or i can do a multi array $map[]['x] = $row['x']; $map[]['y'] = $row['y']; $map[]['type'] = $row['type']; and then echo it out as a table later down? First version would require lots of GD, (but could be done via na extenral file, the second requires no GD but spalshes out 100 images and must echo out a 10x10 table. 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.