<?php
// include Database connection file
include("db_connection.php");

// check request
if(isset($_POST))
{
    // get values
    $id = $_POST['id'];
    $first_name = $_POST['first_name'];
    $last_name = $_POST['last_name'];
    $dni = $_POST['dni'];
    $email = $_POST['email'];
    $doc = $_POST['doc'];

    // Updaste User details
    $query = "UPDATE tabla1 SET paciente='$first_name',nombre='$last_name',dni='$dni',email='$email',usuario='$doc' WHERE id_pac = '$id'";
    if (!$result = mysqli_query($con, $query)) {exit(mysqli_error($con));}
}