Display SQL results in columns with in a cell
Posted: Sat Aug 07, 2004 7:49 am
Hi all, I have been fighting this for a few days now and I need help
In the section where you see //Get the Players it can return 0 to 150 names which creates a long list down the page. What I need to accomplish is breaking it up in 25 names per column and create however many columns it needs to display all the names.
Any help would be appreciated.
Thanks
John McGrath
In the section where you see //Get the Players it can return 0 to 150 names which creates a long list down the page. What I need to accomplish is breaking it up in 25 names per column and create however many columns it needs to display all the names.
Any help would be appreciated.
Thanks
John McGrath
Code: Select all
//Start the Table
echo "<table align='center' cellpadding='0' cellspacing='0' border='0'><tr><td valign='top'>";
echo "<table align='center' cellpadding='0' cellspacing='0' border='0'>";
echo "<tr><td>Server :</td><td>",$JOname,"</td></tr>";
echo "<tr><td>Type :</td><td>",$JOtype,"</td></tr>";
echo "<tr><td>Players :</td><td>",$JOnum,"/",$JOmax,"</td></tr>";
echo "<tr><td>Map :</td><td>",$JOmap,"</td></tr>";
echo "<tr><td>Region :</td><td>",$JOregion,"</td></tr>";
echo "<tr><td>Time of Day :</td><td>",$JOtimeday,"</td></tr>";
echo "<tr><td>Country :</td><td>",$JOco,"</td></tr>";
echo "<tr><td>Skins :</td><td>",$JOskins,"</td></tr>";
echo "<tr><td>Tracers :</td><td>",$JOtracers,"</td></tr>";
echo "<tr><td>PB :</td><td>",$JOpb,"</td></tr>";
echo "<tr><td>pwd :</td><td>",$JOpwd,"</td></tr>";
echo "<tr><td>Age :</td><td>",$JOage,"</td></tr>";
echo "<tr><td>MSG :</td><td>",$JOmsg,"</td></tr>";
echo "</table>";
//Get the players
$JOplayer = mysql_query("SELECT * FROM e_players WHERE rid = '$rid' ORDER BY name");
//Start the Table
echo "</td><td valign='top'>";
echo "<table align='center' cellpadding='0' cellspacing='0' border='0'>";
echo "<tr><Td align='left'><b>Players</b></td></tr>";
$i = 0;
while($JOquery = mysql_fetch_array($JOplayer)) {
$i = $i++
$JOname = $JOqueryї"name"];
//Fill the table with data
echo "<tr><td>",$JOname," </td></tr>";
}
echo "</table>";
echo "</td></tr></table><br><br>";