<?php
    $json = file_get_contents('php://input');   
    $obj = json_decode($json);
    
    $id = $obj->flag;
    // Returns a Json
    header('Content-Type: application/json');
    date_default_timezone_set('America/Mexico_City');
        
     //obtiene el qr actual
    $conn = new mysqli("directoriofitness.com.mx", "direct18", "L4LL4v3M@3str@",$obj->bd);
    $conn -> set_charset("utf8");
    $query ="SELECT token_qr FROM socios WHERE idSocio = $obj->id";
 
    if($conn->query($query) === TRUE){
        echo 'Success';
    }else{
        echo $query.' '.$conn->error;
    }
            
    $conn->close();
         
?>