
April 11th, 2003, 10:19 AM
|
|
Junior Member
|
|
Join Date: Apr 2003
Posts: 9
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
SQL query? Help with multiple fields LIKE, NOT LIKE, OR
I want to setup a query that searches different fields using options such as LIKE, NOT LIKE, and OR. Is OR an option for queries. I can get it to search between the 2 dates like I want and pick all records in the field GroupSess that arent "None".
PHP Code:
$query = "SELECT * FROM records WHERE ".date." BETWEEN '%".$thedate."%' AND '%".thedate1."%' AND
".GroupSess." NOT LIKE 'None' ";
But how do I go further with this like if the GroupSess field is blank in the record I dont want it to show up on query, so I tried this and didnt work
PHP Code:
$query = "SELECT * FROM records WHERE ".date." BETWEEN '%".$thedate."%' AND '%".thedate1."%' AND
".GroupSess." NOT LIKE 'None' OR NOT LIKE ' ' ";
Thanks Nick
|