<?php
include 'db.php';

$data=array();

$q=mysqli_query($conn, "SELECT `idD-VISITAS` as idvisi, 
`NOMBRE-VISITAS` as nombrev, `APELLIDO-VISITAS` as apellidov
 FROM `d-visitas` WHERE `user-caf_idUSER-CAF` = '$idusercaf' AND `FRECUENTE-VISITAS` = 1");

while ($row=mysqli_fetch_object($q)){
 $result[]=$row;
}
echo json_encode($result);
?>

