I have a syntax error in my code, but I can not find which one is wrong. This is the error I'm getting:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where
categoria
=' hydrosanitario '' at line 1
My code:
$teste=mysqli_real_escape_string($conexao,$id);
$sql2 = "SELECT * FROM 'downloads' order by datacadastro DESC where 'categoria'= '".$teste."'";
I have already searched in several places and the closest answer to my problem I encountered was to put $teste
the way I already put it in the above code.