<?php

include ('../../composants/connect-bdd/connexion_bdd.php');

$id = $_POST['id'];

$pathToImg = $_POST['pathToImg'];

$req = $bdd->prepare(" UPDATE admin SET avatar=:avatar WHERE id=:id");
$req->execute(array(
    'avatar' => 'img/avatars/' . $pathToImg,
    'id' => $id
));

$req->closeCursor();

?>
