Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.