I'd like to do a check for some defined variables inside my query. I was hoping to do something like this but this of course doesn't work...
query = "SELECT * ".
"FROM table".
"where id = 1 "
if(isset($GET[variable1])){
."and variable1 = $GET[variable1] "}
if(isset($GET[variable2])){
."and variable2 = $GET[variable2] "};
Any suggestions how I could get something like this to work? Thanks!