chupcha Posted August 15, 2008 Share Posted August 15, 2008 Alrighty everyone. I'm stumped and spent the last three hours trying to figure this out.... lets start off with the background; I need to output a table, 10x10. Think of it as a grid with x and y axis. (if you can think of something better than a table, let me know). So, each user has a unique x,y assigned to them. Based on the user's x,y i need to output the table with each <td> showing if there is another user next to them. Lets say the <td>s are occupied by an image icon. here is my mysql: $query = "SELECT * FROM users_location WHERE (x < %d AND x > %d) AND (y < %d AND y > %d) ORDER BY x ASC"; here is the table structure: users_location -> uid (user id) -> iconid (the icon to display in the <td>) -> x -> y so that returns me everything in the range of the initial x,y that I used. How on earth would I loop and output this??!??!?!!? Please let me know in detail, cause im [.....]this close to throwing the lap top out the window and applying for a job at McDonalds. Quote Link to comment https://forums.phpfreaks.com/topic/119842-php-grid-10x10-output/ Share on other sites More sharing options...
JonnoTheDev Posted August 15, 2008 Share Posted August 15, 2008 This doesnt make much sense. You need to create a static page template displaying what you are trying to achieve dynamically. Quote Link to comment https://forums.phpfreaks.com/topic/119842-php-grid-10x10-output/#findComment-617409 Share on other sites More sharing options...
chupcha Posted August 15, 2008 Author Share Posted August 15, 2008 This doesnt make much sense. You need to create a static page template displaying what you are trying to achieve dynamically. Not sure if making a static page will work since the data would always be changing. How would you go about doing your static page proposal? Quote Link to comment https://forums.phpfreaks.com/topic/119842-php-grid-10x10-output/#findComment-617437 Share on other sites More sharing options...
JonnoTheDev Posted August 15, 2008 Share Posted August 15, 2008 No, a static page is just HTML - no PHP and not for your application. Its a template to show what the page will look like after you put your dynamic bits in. Without an example of what the page is supposed to look like its hard to give any suggestions on how to make it work dynamically. So for your users location page you make a users-location.html that is basically displaying the layout or what would be the final output. Then when the code is inserted to make it a dynamic page we end up with a users-location.php file Quote Link to comment https://forums.phpfreaks.com/topic/119842-php-grid-10x10-output/#findComment-617448 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.