I am trying to create a profile picture function for my website. The file upload and image display functions are working properly, however, it won't update the "profile" column in my table to the image name.

My database name is "intranet" and the table name is "profile". Here is my source code:

```
<?php session_start();
    $_SESSION['username'];
?>

<?php
    if(isset($_POST['submit'])){
            move_uploaded_file($_FILES['file']['tmp_name'],"images/profile/".$_FILES['file']['name']);
            $con = mysqli_connect("localhost","root","","intranet");
            $q = mysqli_query($con,"UPDATE user SET profile = '".$_FILES['file']['name']."' WHERE username = '".$_SESSION['username']."'");
    }
?>

 <!DOCTYPE html>
<html>
    <head>

    </head>
    <body>
            <form action="" method="post" enctype="multipart/form-data">
                    <input type="file" name="file">
                    <input type="submit" name="submit">
            </form>

            <?php
                    $con = mysqli_connect("localhost","root","","intranet");
                    $q = mysqli_query($con,"SELECT * FROM user");
                    while($row = mysqli_fetch_assoc($q)){
                            echo $row['Username'];
                            if($row['profile'] == ""){
                                    echo "<img width='100' height='100' src='images/profile/default.jpg' alt='Default Profile Pic'>";
                            } else {
                                    echo "<img width='100' height='100' src='images/profile/".$row['image']."' alt='Profile Pic'>";
                            }
                            echo "<br>";
                    }
            ?>
    </body>
</html>

```