What is the problem, It is printing the same whatever I do? A help would be appreciated.
<?php 
if(isset($_POST['submit'])) {
$username = $_POST['username'];
$password = $_POST['password'];
$connection = mysqli_connect('localhost', 'root', '', 'ayaneshapp');
    if($connection) {
    echo "Logged in!";
    } else {
    die("Sorry! Something went wrong.");
    }
    $query = "SELECT * FROM ayaneshtable ";
    $result = mysqli_query($connection, "SELECT * FROM ayaneshtable");
    if(!$result) {
    die('404 ERROR');
    }
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
<div class="container">
    <div class="col-sm-6">
        <?php 
            while($row = mysqli_fetch_row($result)) {
                echo $row['username'];
            }
        ?>
    </div>
</div>  
</body>
</html>
 
     
    