ok, after few hours of brainstorming (or rather brainkilling=))) i came up with something like this;
http://www.ususur.org/i
please, check it out and tell me am i going in better direction now? you can click around and submit a form if you want....
anyway, now i have two tables;
one which will describe the cell itself (x, y and something third) and other with user information... id of a map_coordinates table is a key for map_id in map_users table.
for now i'm sure that i am missing something banal here but i cannot get my script to display ALL users on specific cell... i mean, if there are more than 1 user, it displays sum of them minus 1 (so if there are 5 users, i will see only 4)..
here is a part with that table;
//printing main table
echo "<table border=\"0\" align=\"center\" cellpadding=\"1\" cellspacing=\"0\" bgcolor=\"#CCCCCC\"><tr><td>";
echo "<table border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#FFFFFF\">";
for ($x = 1; $x <= 10; $x++) { //loop for x coordinate
echo "<tr>";
for ($y = 10; $y >= 1; $y = $y-1) { //loop for y coordinate
//selecting user(s) on specific coordinate
$selekt_users = (mysql_query("SELECT * FROM map_coordinates, map_users WHERE map_coordinates.id = map_users.map_id AND map_coordinates.x = ".$x." AND map_coordinates.y = ".$y."")) or die(mysql_error());
$users_on_cell = mysql_num_rows($selekt_users);
$row = mysql_fetch_assoc($selekt_users); //this one is for case than only one user exists on cell
if ($users_on_cell > 1) { //checking if there is more than 1 user on cell
$content = "x".$x.":y".$y." OPTION ".$row['option']."</b><br /><br />";
while ($rows = mysql_fetch_array($selekt_users)) { //looping through all users on that cell
$content .= $rows['user_name']."<br />".$rows['description']."<br /><br />"; //displaying users' data
}
} else {
$content = "x".$x.":y".$y." OPTION ".$row['option']."<br /><br />".$row['user_name']."<br />".$row['description'];
}
$content_coords = "x".$x.":y".$y; //content of empty cell
if ($row['y'] == $y AND $row['x'] == $x) { //checking if there is any users on that cell
echo "<td class=\"tablica_border\" width=\"40\" height=\"30\" onMouseover=\"ddrivetip('".$content."', '#EFEFEF')\"; onMouseout=\"hideddrivetip()\" bgcolor=\"".$row['colour']."\"> </td>";
} else { //if no users on cell just print coordinates
echo "<td class=\"tablica_border\" onMouseover=\"ddrivetip('".$content_coords."', '#EFEFEF',50)\"; onMouseout=\"hideddrivetip()\" width=\"40\" height=\"30\"> </td>";
}
}
echo "</tr>";
}
echo "</table>";
echo "</td></tr></table>";