0
I have a syntax error in my code, but I can’t find my error.
That’s the mistake 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
= 'Hydrosanitary'' 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 looked in several places and the closest answer to my problem I found was to put the $teste
the way I already put it in the code above.