<?php 
include("db_config.php"); 
if($_SERVER['REQUEST_METHOD']=='POST'){
     $user_id = $_POST['user_id'];
      $cart_id=$_POST['cart_id'];
       $ct_id = explode(",",$cart_id);
       foreach($ct_id as $pm_id){
	 $query="select addto_cart.*,product.prod_img1,product.prod_name from addto_cart join product on addto_cart.prod_id=product.id where addto_cart.user_id='$user_id' and addto_cart.id='".$pm_id."' ";
	 $result = mysqli_query($conn, $query);
	
	if(mysqli_num_rows($result) > 0) {
		while($row[] = mysqli_fetch_assoc($result)) {
		 $tem = $row;
		 }
	  $response['data']=$tem;
	  $response['status']=1;
	}
	else {
		//$json =  json_encode(array("status" => 0, "msg" => "data Not Found!"));
		$response['status']=0;
	}
	}
	
	echo json_encode($response);
	mysqli_close($conn);
}