<?php

    header("Access-Control-Allow-Origin: *");
    header("Content-Type: application/json");
    header("Accept: application/json");

    require '../config/conn.php';

    $uId=$_POST['uId'];
    $name=$_POST['name'];
    $avatar=$_POST['avatar'];

    $updateData="UPDATE `users` SET `name`='$name', `avatar`='$avatar' WHERE `uId`='$uId'";

    $update=mysqli_query($conn,$updateData);

    if($update)
    {
        $response['statusCode']=0;
        $response['message']="Data updated";
    }
    else
    {
        $response['statusCode']=4;
        $response['message']="Error occurred in updating data";  
    }

    echo json_encode($response);

?>