The user who has logged in his account should change his profile photo and I seem to have a trouble doing it. The photo inserts in the `profile` table but not in the row of the user logged in. It just creates another record to the database.
I currently have this in my profilephoto.php:

```
<?php
    include 'session.php';
    ?>
    <form action="update.php" method="POST"  enctype="multipart/form-data">
             <input type="file" name="file_upload" class="form-control">
             <input type="submit" name="submit" value="Change Photo" style="float: right"/> 
    </form>

```

And this is my update.php

```
<?php
session_start();
include_once('dbcontroller.php');
if(isset($_POST['submit'])) {

    if(move_uploaded_file($loc, '../admin/profile-avatars/'.$final_file)) {
        $sql = mysqli_query($conn, "INSERT INTO profile WHERE username='$login_session' (profilePhoto, photoType, photoSize) VALUES('$final_file','$type','$new_size')");

        echo "<script type='text/javascript'>alert('Profile successfully updated.');
                window.location.assign('profilephoto.php');</script>";
    }
}

?>

```

EDIT:
It's working now. Thank you Sagar Patel and DevilaN :)
My mistake was in my query which is :

```
$sql = mysqli_query($conn, "INSERT INTO profile WHERE username='$login_session' (profilePhoto, photoType, photoSize) VALUES('$final_file','$type','$new_size')");

```

which should be:

```
$sql = mysqli_query($conn, "UPDATE profile SET profilePhoto='$final_file', photoType='$type', photoSize='$new_size' WHERE username='$login_session'");

```