I'm trying to use wildcard character as query criteria in my query, but the result is returned empty.
include_once ("../ inc / connection.php");
$lj = "4";
$linha = isset($_GET['ans'])?$_GET['ans']:"";
$data = date("d-m-Y");
$partes = explode("-", $data);
$ano = $partes[2];
$periodo = "$ano%";
$sql = "SELECT sjy_vendas.tipo, Sum(sjy_vendas.qt) AS qt, Sum(sjy_vendas.qtv) AS qtv, Sum(sjy_vendas.rprd) AS rprd, Sum(sjy_vendas.rsrv) AS rsrv, Sum(sjy_vendas.tprd) AS tprd, Sum(sjy_vendas.tsrv) AS tsrv, Sum(sjy_vendas.vlr_compra) AS vlr_compra
FROM sjy_vendas
WHERE sjy_vendas.empresa = $lj
AND sjy_vendas.tipo = $linha
AND dt_nf CONCAT('%',:param,'%')
GROUP BY sjy_vendas.tipo";
$sql->bindParam(':param',$ano);
$consulta = mysqli_query($conexao,$sql);
while($dados = mysqli_fetch_array($consulta)){
$qtv = $dados['qtv'];
$rprd = $dados['rprd'];
}
echo "Quantidade: " . $qtv . "<br />";
echo "Receita: " . $rprd . "<br />";