连mysql中文乱码解决:
$db->set_charset("utf8");
mysqli若直接写成
$total = mysqli_fetch_array($result)[0];
则会出错,可以改成
$arr = mysqli_fetch_array($result);
$total = $arr[0];
本文介绍了如何在MySQL中设置字符集以解决中文乱码的问题,并提供了使用mysqli时避免数据获取错误的具体方法。
$db->set_charset("utf8");
mysqli若直接写成
$total = mysqli_fetch_array($result)[0];
则会出错,可以改成
$arr = mysqli_fetch_array($result);
$total = $arr[0];
4537
2329
2716

被折叠的 条评论
为什么被折叠?