PHP Code:
<!--Edit these variables to your own!-->
Well, I think you forgot a line then.
PHP Code:
//KILLS THE MYSQL CONNECTION AFTER EXITED
It doesn't kill the connection after the user
exited the page but when the PHP reached that line.
PHP Code:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
Why ISO-8859-1 ?
PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
As of HTML 5 you don't need everything after the
PUBLIC
PHP Code:
<!DOCTYPE html>
PHP Code:
if (mysqli_num_rows($result) > 0) {
Eh, another one :v
why not simply
PHP Code:
if(mysqli_num_rows($result)) {
PHP Code:
while($row = mysqli_fetch_assoc($result)) {
//HTML codes inside of "echo" represent the actual *html* code.
echo "<div class='tablestuff2 table'>";
echo "<table border='1'>";
echo "<thead>";
echo "<tr>";
echo "<th id='th1' style='width: 150px'><font color = 'red'>Banned Player</font></th>";
echo "<th id='th2' style='width: 150px'><font color = 'red'>Banned By</font></th>";
echo "<th id='th3' style='width: 150px'><font color = 'red'>Banned Reason</font></th>";
echo "</tr>";
echo "</thead>";
echo "</table>";
echo "</div>";
while($row = mysqli_fetch_assoc($result))
{
echo "<div class='tablestuff2 table'>";
echo "<table border='1'>";
echo "<tbody>";
echo "<tr>";
echo "<td headers='th1' style='width: 150px'>".$row['player_banned']."</td>";
echo "<td headers='th2' style='width: 150px'>".$row['banned_by']."</td>";
echo "<td headers='th3' style='width: 150px'>".$row['banned_for']."</td>";
echo "</tr>";
echo "</tbody>";
echo "</table>";
echo "</div>";
}
}
Why you made two while loops and used so many "echo" ?
You can sum it into one "echo"
PHP Code:
$sql = "SELECT ban_id, bannedby, bannedfor, playerbanned FROM users";
You selected these columns, yet
PHP Code:
echo "<td headers='th1' style='width: 150px'>".$row['player_banned']."</td>";
echo "<td headers='th2' style='width: 150px'>".$row['banned_by']."</td>";
echo "<td headers='th3' style='width: 150px'>".$row['banned_for']."</td>";
You're outputing them with underscore _
EDIT: Tested, the first while loop deletes the first ban.