Building a PHP and MySQL search function
I’ve been working on the search feature of komparison. Specifically, making sure multi-word searches like peanut butter crackers work well. Let’s say we have some a food item stored as Crackers, wheat, sandwich, with peanut butter filling and the user searches for peanut butter crackers. If the search is coded simplistically like: SELECT * FROM some_table WHERE some_field LIKE ‘%peanut butter crackers%’ or: SELECT * FROM some_table WHERE some_field LIKE ‘%peanut%butter%crackers%’ Then we won’t get any results because the ordering