I am currently programming a system to tell users bans from a database. However, It is only returning one result.
How would I change this to echo more than one result?
<?php
include("check.php");
?>
<?php
mysql_connect("localhost", "root", "[PASSWORD]") or die(mysql_error());
mysql_select_db("bans") or die(mysql_error());
$query= mysql_query("SELECT * FROM bans WHERE name = '".$_SESSION['username']."' ")or die(mysql_error());
$arr = mysql_fetch_array($query);
$num = mysql_numrows($query); //this will count the rows (if exists)
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Home</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<h1 class="hello">Hello, <em><?php echo $login_user;?>!</em></h1>
<a href="logout.php" style="font-size:18px">Logout?</a>
</body>
</html>
<html>
<?php if($num > 0){ ?>
<h1>Your Punishments</h1>
<p>Type: <?php echo $arr['type']; ?></p>
<p>Reason: <?php echo $arr['reason']; ?></p>
<?php }else{ ?>
User not found.
<?php } ?>
</html>
</div>