Hi , i was wondering if anyone could help me figure out how to do this , im new to SQL and PHP so im not sure if what ive done is right. I was wondering how i would search for four different variables in a mysql database in one query string like
Im trying to get the database to return the results from this search but my problem is some of the fields may be blank and im not sure if ive used the right syntax for this, any help would be welcome. thanks in advance
$query ="select * from database where $var1 like "this" or $var2 like "that" or $var3 like "or that" or $var4 like "this";"
$result = mysql_query($query);