Hello. I'm trying to make a comparison in PHP and the IF does not work for nothing. I've tried it in many ways and it did not work.
The code is:
if(($_GET['categoria']) == 0) {
$mysql = new conexao();
echo 'Erro';
}else{
$mysql = new conexao();
$result = $mysql->sql_query("select * from TB_GALERIA where CATEGORIA=".$_GET['categoria']." ");
while ($row = mysql_fetch_assoc($result)) {
echo '<div class="item">';
echo '<a class="item-hover" href="../../../uploads/midia/15989/maior_maior_DSC_0108.jpg">';
echo '<img src="images/'.$row["IMAGEM"].'" alt="imagem galeria" class="img-responsive lazyOwl" data-src="/images/';
echo $row["IMAGEM"];
echo '">';
echo '</a>';
echo '</div>';
}
}
What's wrong with if? Thanks!