Welcome Guest, Not a member yet? Register   Sign In
get_where() failing on accented characters
#1

[eluser]MunterMan[/eluser]
I am working through the codeigniter tutorial but using my own database. On this page

http://ellislab.com/codeigniter /user-guide/tutorial/news_section.html

there is a use of the method get_where(). If I use the word "Rancé " (that is an e with an acute accent over it) in the MATCH field it returns null. Everything is UTF-8.

How do I get it to search the database using European characters?
#2

[eluser]Tpojka[/eluser]
You can do that with text helper and convert_accented_characters() function.
#3

[eluser]MunterMan[/eluser]
That wont help. The name is stored on the database with the accent, I need the accented é to match it.
#4

[eluser]Tpojka[/eluser]
You will need 2 queries in that case.
One that select all text and convert it with mentioned function to accent free.
And second one that will search term in it.
To avoid multiple queries during execution, you can make one more column in table where you will store non-accented text which you can use for search.




Theme © iAndrew 2016 - Forum software by © MyBB