I stored my SQL query in database and at this query i used PHP variable; then when i fetch the data from MySQL the variable which used in query does not work and query die! what should i do?
Exp: I stored this query on database:
"SELECT * FROM mytable WHERE id='$id' OR name='$name'"
and then when fetch this query the variables does not work in code like this:
mysqli_query($conn,$sql)
or
mysqli_query($conn,"$sql")