I have a problem in PHP when sending data to filter if I do it with the "=" no problem brings me the records but if I try to do it with LIKE, it does not return anything.
It's the tm_profesor_dni.
public function buscar_profesor_dni($dni){
$conectar= parent::conexion();
$dni = $_POST["dni"];
$sql="SELECT tm_profesor.pro_id, tm_tipo_documento.td_nom, tm_profesor.pro_dni, tm_profesor.pro_apep, tm_profesor.pro_apem,
tm_profesor.pro_nom, tm_region.reg_cod + tm_profesor.pro_dni AS 'nrocolegi', tm_region.reg_nom, tm_ugel.ug_nom
FROM tm_profesor
INNER JOIN tm_region ON tm_profesor.reg_id = tm_region.reg_id
INNER JOIN tm_ugel ON tm_profesor.ug_id = tm_ugel.ug_id
INNER JOIN tm_tipo_documento ON tm_profesor.td_id = tm_tipo_documento.td_id
INNER JOIN tm_sexo ON tm_profesor.sex_id = tm_sexo.sex_id
WHERE
tm_profesor.est='1' AND
tm_profesor.pro_dni LIKE '%?%'";
//echo $sql; //Imprime la consulta en consola.
$sql = $conectar->prepare($sql);
$sql->bindValue(1,$dni);
$sql->execute();
return $result = $sql->fetchAll(PDO::FETCH_ASSOC);
//print_r($_POST); //Para ver el Array que se envia
}