3
I have in my database words with accents and when I want to call I use this SQL below.
But if a word in the database has accent I need to also use the word accented in my search, otherwise nothing returns.
How do I get around that situation and research both accented and accented words?
SELECT * FROM produtos WHERE status_pr='online' AND (LCASE(nome_pr) LIKE '%$get%'
OR LCASE(descricao_pr) LIKE '%$get%' OR LCASE(marca_pr) LIKE '%$get%'
OR LCASE(linha_pr) LIKE '%$get%' OR LCASE(categoria_pr) LIKE '%$get%')
In the code above, $get is the PHP variable that will be searched for.
Which charset and collate is being used?
utf8
, except for the leotardutf8_bin
, ignores accentuation in the LIKE.– Thomas
cherset is utf8_bin the collate I’m not using
– Aron Brivio
utf8_bin is the collate.
– Thomas