In my users table I have a first and last name field.
I also have a search for user by last name but when there is a user like L’Orange searching for
- lor
- LOr
- L’O
- l’o
does not work while
- L\’O does (which makes sense but not something a user would think of)
So, how can my query account for that? Right now in my query I have
OR (CONCAT(`lName`, ', ', `fName`) LIKE '$term')
I’d like the search lo or l’o to work (I think) Is there any reason the search should require the ‘?
How about you take the incoming search term and apply mysql_real_escape_string to it?
then
should work. The user will have to search for l’o or L’O, but that should work.