+ 1

problem with ä ö ü in mysqlquerry - json_encode

I have the problem that the row in there the row contains an ä ö ü is missing all other rows get printed. choosed utf-8 Kollation. Code: $db_res= mysqli_query($db_link, "SELECT * FROM `module` SET NAMES 'utf8'") or die (mysql_error()); $modulArray = array(); while($row=mysqli_fetch_array($db_res)){ if ($row!=false) { array_push($modulArray, json_encode($row)); }

17th Jan 2019, 9:12 PM
jack
jack - avatar
2 ответов
+ 1
add this constant as a second argument to the json_encode function "JSON_UNESCAPED_UNICODE": https://code.sololearn.com/wwfY2syIJAQH/#php
17th Jan 2019, 9:36 PM
MO ELomari
MO ELomari - avatar
0
the solution was : while($row=mysqli_fetch_array($db_res)){ if ($row!=false) { array_push($modulArray, ($row)); } ;-)
17th Jan 2019, 10:38 PM
jack
jack - avatar