Jump to content

Recommended Posts

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.

 

Link to comment
https://forums.phpfreaks.com/topic/119842-php-grid-10x10-output/
Share on other sites

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?

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.