OK, after starting with a completely blank page other than my recordset for the search to work with, I allowed the search wizard to create the search form and its related fields for me. I then pasted my code to display the search results. So, now I have got a very plain page.
When I test it with something very specific, all records still seem to display based on the settings I used within the wizard. I have asked the wizard to use OR instead of AND, however, if I change the code to AND, the search then works… why?
I am asking it to look in 6 columns of a database table and return results related to the search parameter where one or more of the columns need to match to ensure that the record is displayed in the result, so surely this is a reason to use OR.
Is 'OR' saying match col1 OR col2 OR col3 OR col4 OR col5 OR col6 and show any record that does actually contain the text searched for whereas 'AND' is saying all cols must match before a record displays?
I simply changed:
$WADbSearch1->keywordComparison($KeyArr0,"".((isset($_POST["distsearch"]))?$_POST["distsearch"]:"") ."","OR","Includes",",%20","%20","%22","%22",0);
to
$WADbSearch1->keywordComparison($KeyArr0,"".((isset($_POST["distsearch"]))?$_POST["distsearch"]:"") ."","AND","Includes",",%20","%20","%22","%22",0);
for it to work.
Have I completely misunderstood the purpose between OR and AND in a search?