MYSQL responds differently to similar queries
I am using xamp server:
when i run select query to get data like
SELECT `id`, `relation`, `member_id`, `Relative_id`
FROM `relationship` WHERE `relation` = 'माँ'
Everything works perfectly
But when running below example queries, I get 0 results.
Example 1:
SELECT `id`, `relation`, `member_id`, `Relative_id`
FROM `relationship` WHERE `relation` = 'बेटी'
Example 2:
SELECT `id`, `relation`, `member_id`, `Relative_id`
FROM `relationship` WHERE `relation` = 'पिता'
image referring to db table
Table structure : table structure
+3
AJAY RAGHUVANSHI
source
to share
2 answers
You have to use the Unicode character set (utf8_unicode_ci works great), declare the field as VARCHAR
and use LIKE
instead=
SELECT `id`, `relation`, `member_id`, `Relative_id`
FROM `relationship` WHERE `relation` LIKE 'पिता';
Tested and working.
+2
tony gil
source
to share
To compare a language, you need to use an encoding UTF-8
.
Use mysqli_set_charset
+1
Ravi
source
to share