Reputation: 591
I'm working in a voice recognition algorithm that looks for matches at a DataBase(MySQLi). My problem is that if I recognize something like: Milk Shake, and I have Milkshake at my DB (without white space) then I wont have a Math by using LIKE.
WHERE products.status = 1 AND products.product_name LIKE "%'.$key.'%"
Is there a way to get a match with Milk Shake and Milkshake at my Database? *delete all white spaces is not an option.
Upvotes: 3
Views: 47
Reputation: 32
It looks like the following statement achieves what you are tying to do.
WHERE products.status = 1 AND products.product_name LIKE '%Milk%Shake%';
Upvotes: 2