<?php
$matricula = $_GET['term'];  
$conexion = new mysqli('localhost','losrobles_userbd','ZjQ0WFmMzcyMjU4TdmYTQw','losrobles_app_hc',3306);
$conexion->set_charset("utf8");
/* $matricula = "PRUEBA"; */

/* $consulta = "SELECT name,cc FROM hc_paciente WHERE name = '$matricula'";  */
$consulta = "SELECT name,cc FROM hc_paciente WHERE name LIKE '%$matricula%' OR cc LIKE '$matricula%'";

$result = $conexion->query($consulta);
$matriculas = new stdClass();
if($result->num_rows > 0){
	while($fila = $result->fetch_array()){
		$matriculas[] = $fila['name'];		
	}
	echo json_encode($matriculas);
};
?>