<?php
$json = file_get_contents('php://input');   
    $obj = json_decode($json);
    $id = $obj->flag;
    $msg;
    
    // Returns a Json
    header('Content-Type: application/json');
    
   
    $conn = new mysqli("directoriofitness.com.mx","direct18","L4LL4v3M@3str@",$obj->bd);
    $conn -> set_charset("utf8");
    
    $array;

    $query = "SELECT idServicio,NombreServicio,Tipo,PVisita,Sucursal FROM servicios WHERE idServicio = '$obj->idServicio'";
    
    $resultado = $conn->query($query);
        
    $array[] = $resultado->fetch_assoc();
    
    echo json_encode($array);
    
    $conn->close();
?>