if (isset($_POST['id_task'])){
$user_task=$_POST['id_task']; //получаем номер задачи
}
if (isset($_POST['Answer'])){
$user_answer=$_POST['Answer']; //получаем ответ пользователя
}
else {
$user_answer='0';
}
$query = "INSERT INTO User_Answer(ID_Task,ID_Answer) VALUES($user_task,$user_answer)";
$res = mysqli_query($db, $query);