I'm working on a project involving PHP and MySQL. I admit that I'm pretty new to both.
I have a table that has some company names, let's say CocaCola, if the user searches CocaCola, I have to read some info from the table. My question is, how can I make it work even if the user writes CocaCola Company, or anything else that matches?
I already implemented SOUNDEX which gives a basic error handling, but now I'd like something that allows me to check if the name that's inside my table (CocaCola) matches the string coming from the user ("CocaCola Company" includes "CocaCola").
I found the "LIKE" statement
WHERE Name LIKE %$name%
but it seems it works the way around, it can detect if the user writes something less, but how to detect if he/she writes something more? (something like
WHERE %Name% LIKE $name
if it even exists).