Jump to content

Search engine with accents


kickoutbettman

Recommended Posts

Hello all,

 

I created a little simple search engine and it works great for what I need.

My only problem, is the data in MySql DB might contain some accents such has : é à è ê

And some people will not put the accent and others will.

 

Is there any way to let my search engine returns both results ?

 

Thank you

 

Link to comment
https://forums.phpfreaks.com/topic/159566-search-engine-with-accents/
Share on other sites

You are right, it does work with MySql.

It returns the good result.

 

The problem is that I use PHP and a HTML form to grab the input from the user then assign it to $filter.

 

$filter = $_GET['textfield'];

SELECT * FROM city WHERE cityName LIKE '%$filter%'

***city example = Montréal ***

 

So when I do that and type "Montreal" it returns nothing. But if I type "Montréal" it returns Montréal.

The collation for my table = utf8_general_ci (so it should manage the accents correctly).

 

Anybody knows whats happening ?

 

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.