<?php
include("../../base.php");
if (isset($_GET['hab'])) {
                                           $query = mysqli_query($con ,"select n_reg,fnumcto,fnombre,fapellido,GROUP_CONCAT(fnorasvip) as fnorasvip  from valeryus19 where fnumcto='" . trim($_GET['hab']) . "' and (status='HUESPED' or status='MISCELANEOS')");
                                       //    echo "select * from valeryus19 where fnumcto='" . trim($_GET['hab']) . "' and (status='HUESPED' or status='MISCELANEOS')";
                                           $regh = mysqli_fetch_assoc($query);
                                            //  echo json_encode($regh);
                                         //  var_dump($query);
                                           if (mysqli_num_rows($query) == 0) {
                                              echo "0";
                                           } else {
                                               echo json_encode($regh);
                                           }
                                       }  
 
?>