无法更新数据库

i want to update my data from database but unfortunately i can't be update. there is anyone can help me.

i will be appreciated.

the problem is error can not show when my code does wrong. sorry for my bad english.

here is my code

<?
include "new.php";
$response = array("updated data", 1);
if (isset($_POST['ID_Person']) && isset($_POST['FirstName']) && isset($_POST['MiddleName']) && isset($_POST['LastName']) && isset($_POST['AliasName']) 
&& isset($_POST['Gender']) && isset($_POST['CityBirth']) && isset($_POST['DateBirth']) && isset($_POST['MonthBirth']) && isset($_POST['YearBirth'])) 
{
    $id = $_POST['ID_Person'];
    $name =  $_POST['FirstName'];
    $middle =  $_POST['MiddleName'];
    $last =  $_POST['LastName'];
    $alias =  $_POST['AliasName'];
    $gender =  $_POST['Gender'];
    $citybirth =  $_POST['CityBirth'];
    $datebirth =  $_POST['DateBirth'];
    $monthbirth =  $_POST['MonthBirth'];
    $yearbirth =  $_POST['YearBirth'];
    $hasil = sqlsrv_query($conn,"UPDATE T_Person SET
        First_Name_Person = '$name' ,
        Middle_Name_Person = '$middle' ,
        Last_Name_Person = '$last' ,
        Alias_Person = '$alias',
        Gender_Person = '$gender', 
        City_Birth_Person = '$citybirth', 
        Date_Birth_Person = '$datebirth', 
        Month_Birth_Person = '$monthbirth',
        Year_Birth_Person = '$yearbirth',
        WHERE ID_Person = '$id'"
    );
    $rows_affected = sqlsrv_rows_affected($hasil);
    if ($rows_affected === false) 
    {
        die( print_r( sqlsrv_errors(), true));
    }       
    if ($hasil)
    {
        $response["success"] = 1;
        $response["message"] = "Product successfully edit.";
        // echoing JSON response
        echo json_encode($response);
    }
}
else {
    echo 'Data fail update';
}
?>

You have an error in your query with comma juste before WHERE

$hasil = sqlsrv_query($conn,"UPDATE T_Person SET First_Name_Person = '$name' , 
                                                 Middle_Name_Person = '$middle' , 
                                                 Last_Name_Person = '$last' ,
                                                 Alias_Person = '$alias',
                                                 Gender_Person = '$gender', 
                                                 City_Birth_Person = '$citybirth', 
                                                 Date_Birth_Person = '$datebirth', 
                                                 Month_Birth_Person = '$monthbirth', 
                                                 Year_Birth_Person = '$yearbirth',
                                                                 no comma here   ^
                                              WHERE ID_Person = '$id'");

Try to echo your query in the PHP and copy paste this query in phpMyAdmin.

Please remove comma after this,

Year_Birth_Person = '$yearbirth'

i guess there is no T_Person with ID_Person == $id in your table so nothing is updated