I have a very noobish question right here. How can I use PHP in my PHP SQL query?
My query is
mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM shop WHERE categorie='4' AND actief='1' ORDER BY prijs + 0 ASC");
and what I'm trying to have is this
mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM shop WHERE categorie='4' AND ". if(htmlentities($gegevens['rang']) == '1') { echo ""; } else { echo "actief='1'";} . " ORDER BY prijs + 0 ASC");
How can I get this to work?