<?php
require_once('db.php');
$conn = mysqli_connect($servername, $username, $password, $dbname);
// sales master
$cart = json_decode($_POST['cart']);
mysqli_set_charset($conn,'utf8');
    




// echo (json_encode($run));
// exit;
// $salesMasterId = mysqli_insert_id($conn);


// // sales details

 foreach($cart as $value) {
  
     $salesDetails = "insert into  check_sms (name, address, body)
        values('$value->name', '$value->address', '$value->body')
     ";
     $run = mysqli_query($conn,$salesDetails);

 }


if($run==true){
	echo"Successfull";
	echo json_encode($cart);
}
else{
    echo "Failed";
}

?>