0

Hello all,

I have a feeling this is easy to deal with (at least I hope so) but couldn't find much on google, probably because I'm not 100% sure how to word it. Here goes...

We all know how there's different representations for apostrophes. There's the ’ character and then there's '. This is affecting the search application on my website. If someone searches for John's Music, but it just so happens John's Music is entered into the database using the alternate apostrophe (John’s Music), no results will show. How can I correct this issue?

Thanks

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by sneldog
0

The best way to deal with this is to make sure you store only one kind of apostrophe in your database no matter what the user enters. So before storing the value in the database do a str_replace() to strore appropriate apostrophe.
Also in the search module, take the user input and do a str_replace() to change the possible apostrophe to the desired one. Then use this in your query.

I hope this helps.

0

The best way to deal with this is to make sure you store only one kind of apostrophe in your database no matter what the user enters. So before storing the value in the database do a str_replace() to strore appropriate apostrophe.
Also in the search module, take the user input and do a str_replace() to change the possible apostrophe to the desired one. Then use this in your query.

I hope this helps.

It does help, thank you for your input. This was where I was going to go with it but was hoping there maybe have been something a little more direct.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.