I made a query with a join to get information from the database, I tested it in mysql and it worked perfectly, the problem is that it does not work in php, not the execution error but the return is nullo, even if I change the I have used var_dump () to check for syntax error but do not have it.
$query="SELECT t1.* FROM tb_anuncio AS t1 JOIN tb_localizacao AS t2 ON t2.cd_localizacao = t1.cd_localizacao WHERE 1=1 AND t1.cd_categoria =".$categoria->getCd()." AND t2.nm_estado ='".$estado."' AND t2.nm_municipio ='".$municipio."' LIMIT ".$init.",".$max."";
$retorno = $this->conexao->query($query) or die(mysql_error());
while($anuncio = mysqli_fetch_assoc($retorno))
{
$anuncios[] = $anuncio;
}
var_dump:
"SELECT t1.* FROM tb_anuncio AS t1 JOIN tb_localizacao AS t2 ON t2.cd_localizacao = t1.cd_localizacao WHERE 1=1 AND t1.cd_categoria =1 AND t2.nm_estado ='AC' AND t2.nm_municipio ='Acrelândia' LIMIT 0,17"