You want the tage table to receive data rows outside the loop:
echo "<table width='1000' cellpadding='10' cellspacing='5' border='1'>"; while($info = mysql_fetch_array( $data )) { echo "<tr> <td><center><b>".$info['id']."</td></center></b>"."<td><center><b>".$info['username']."</td></center></b>"."<td><center><b>".$info['kills']."</td></center></b>"."<td><center><b>".$info['deaths']."</td></center></b>"."<td><center><b>".$info['ratio']."</td></center></b></tr>"; } echo "</table>";
Since you're new to PHP, I should probably expand this a bit more:
Your code will now display the table open tag:
<table width='1000' cellpadding='10' cellspacing='5' border='1'>
Then go to the while loop and highlight all the lines found:
<tr><td><center><b>Something1></b></td></tr> // shortened for example. <tr><td><center><b>Something2></b></td></tr> <tr><td><center><b>Something3></b></td></tr> <tr><td><center><b>Something4></b></td></tr>
Then, when it exists in the loop, it will output a closing tag for the table:
</table>
What you did earlier is the output of the table for each row of data. For future reference, it is recommended that you study the source code to understand what is happening.
Edit: When I looked at your comment on the code, I formatted it more carefully to find out what is happening, you can make your code more readable in the following format:
echo "<table width='1000' cellpadding='10' cellspacing='5' border='1'>"; while($info = mysql_fetch_array( $data )) { echo "<tr> <td><center><b>".$info['id']."</b></center></td> <td><center><b>".$info['userโโname']."</b></center></td> <td><center><b>".$info['kills']."</b></center></td> <td><center><b>".$info['deaths']."</b></center></td> <td><center><b>".$info['โโratio']."</b></center></td> </tr>"; } echo "</table>";
source share