<?php
require_once('db.php');
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);

mysqli_set_charset($conn,'utf8');
				

$Insert_task_id=trim($_POST['task_id']);
$Insert_userID=trim($_POST['userId']);
$Insert_date=trim($_POST['date']);



  $sql = "INSERT INTO `complete_task`(`task_id`, `userId`, `date`) VALUES ('$Insert_task_id','$Insert_userID','$Insert_date')";
  $run = mysqli_query($conn,$sql);
    
if($run==true){

        $res->success = 'Task Complete';

       echo json_encode($res);
 }
else{
      echo "Failed";
    }


   


?>