Member help
Posted: Tue Aug 17, 2004 3:48 am
I want to seperate all my users into a sector sort of thing with 20 users to one sector. In the sector when there are no users instead of not showing anything and setting a max limit to 20 i want it to display as empty and every time a user joins up from the bottom upwards the empty changes to a user. The current code I have is
But that just loops all the kingdoms and displays nothing when no one has signed up. Any help would be greatly apreciated.
Code: Select all
<?
include 'db.php';
$result = @mysql_query("SELECT kingdom_name, x, y, net FROM users WHERE galaxy='$g' AND sector='$s' ORDER BY userid ASC");
if (!$result) {
echo("<p>Error performing query: " . mysql_error() . "</p>");
exit();
}
while ( $row = mysql_fetch_array($result) ) {
echo("<tr bgcolor=222222><td>" . $rowї"kingdom_name"] . " (X:" . $rowї"x"] . ",Y:" . $rowї"y"] . ")</td>");
echo("<td>" . $rowї"net"] . "</td></tr>");
}
?>