I am having a problem on what I think is a MySQL issue, when I trying fetch a row my the database(mysql) with a column value of ( हिंदी 한êµì–´ اللغة Ø§Ù„Ø¹Ø±Ø¨ÙŠØ ), the result row seems exists and truthy on if condition statements. But when I var_dump it, it show empty, not null.
for example: (php/mysql)
Input Data:
- id -> 1
- name -> Bob
- address -> हिंदी 한국어 اللغة العربية
Stored Data on Table
- [column]id = 1
- [column]name = "Bob"
- [column]address = "हिंदी 한êµì–´ اللغة العربيØ"
Expected Data after being fetched from mysql
- id -> "1"
- name -> "Bob"
- address -> \u00e0\u00a4\u00b9\u00e0\u00a4\u00bf\u00e0\u00a4\u201a\u00e0\u00a4\u00a6\u00e0\u00a5\u20ac \u00ed\u2022\u0153\u00ea\u00b5\u00ad\u00ec\u2013\u00b4 \u00d8\u00a7\u00d9\u201e\u00d9\u201e\u00d8\u00ba\u00d8\u00a9 \u00d8\u00a7\u00d9\u201e\u00d8\u00b9\u00d8\u00b1\u00d8\u00a8\u00d9\u0160\u00d8
$mysql_result_row = array(
"id" => 1,
"name" => "Bob",
"address" => );
echo json_encode($mysql_result_row) // (shows nothing)
echo gettype($mysql_result_row) // array
echo $mysql_result_row['name'] // Bob
echo $mysql_result_row['address'] // (everything stops working, no php nor mysql error logs)
Notes
- The sample above have 3 different set of language / character set.
- हिंदी is Hindi
- 한êµì–´ is Korean
- اللغة Ø§Ù„Ø¹Ø±Ø¨ÙŠØ is Arabic
- Don't ask why a single column has 3 different language because I do not know
- If only one of those languages on that address column, it works, no problem. It only stops working if those 3 combined