From 5174d0ec38a1e991dc138cb2b6cffab8cf81c444 Mon Sep 17 00:00:00 2001 From: Nathan Kinkade Date: Wed, 14 Nov 2012 18:31:52 +0000 Subject: Fixed a bug where the Any Word option wasn't working. Not a plural. --- food_search.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/food_search.php b/food_search.php index cc413f6..69ff15d 100644 --- a/food_search.php +++ b/food_search.php @@ -74,7 +74,7 @@ if ( $_GET['searchType'] == "Exact Phrase" ) { $where = " WHERE (long_desc = '$searchString' OR comname = '$searchString') "; $userWhere = " WHERE description = '$searchString' "; } else { - # if user selected 'Any Words' or 'All Words' then break up the + # if user selected 'Any Word' or 'All Words' then break up the # search string into an array, then count the array so we know # how many search strings we are dealing with then go ahead and # add the first where argument @@ -240,13 +240,13 @@ if ( $db->_rowCount > 0 ) { } } - # if the search type was 'Any Words', then if only 1 of the search + # if the search type was 'Any Word', then if only 1 of the search # string words matched a word from the field 'foodDesc' we have a # match and should add the record, else if the search type was # 'All Words' and all of the search string words matched then add # the record, else don't add anything. if ( - (($_GET['searchType'] == "Any Words") && ($matchCount > 0)) || + (($_GET['searchType'] == "Any Word") && ($matchCount > 0)) || (($_GET['searchType'] == "All Words") && ($matchCount == count($searchStrings))) ) { if ( $_GET['sortType'] == "Category" ) { -- cgit v1.2.3