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

mysqli_set_charset($conn,'utf8');
				


$Insert_userID=trim($_POST['userId']);
$Insert_taskID=trim($_POST['taskID']);
$Insert_date=trim($_POST['date']);



  $sql = "INSERT INTO `week_earn_track`( `taskId`, `userId`, `date`) VALUES ('$Insert_taskID','$Insert_userID','$Insert_date')";
  $run = mysqli_query($conn,$sql);
    
if($run==true){

        $res->success = 'Task Complete';

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


   


?>