+ 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)); }
2 ответов
+ 1
add this constant as a second argument to the json_encode function "JSON_UNESCAPED_UNICODE":
https://code.sololearn.com/wwfY2syIJAQH/#php
0
the solution was :
while($row=mysqli_fetch_array($db_res)){
if ($row!=false) {
array_push($modulArray, ($row));
}
;-)