Forum Moderators: open
This is a segment of the SQL statement containing the code for the key word search:
SQL="SELECT id, agency, city, state, zipcode " SQL=SQL&"FROM db "
SQL=SQL&"WHERE agency LIKE'%" & key & "%'OR address LIKE'%" & key & "%'OR room_suite LIKE'%" & key & "%'"
In the actual code there are several more OR operators and criteria. The rest of the statement defining the other search parameters are concantenated such as this:
SQL=SQL&"AND agency LIKE'%" & org & "%'"
If you wanna check out the working db go here http://www.whatsup.org/test/home.asp
I'm using an access dB if that helps.
"OR" gets more results (General), "AND" gets less results (Specific).
For example, we have three types of cars, Good, Bad and Ugly.
We have three car colours, Black, White and Grey
If you chose "where car like good OR colour like black" then you get all good cars regardless of colour, and all black cars regardless of type.
If you chose "where car like good AND colour like black" then you only get "GOOD BLACK" cars.
Get the idea? I think you would be better using "AND" all the way through.
Onya
Woz