时间:2021-07-01 10:21:17 帮助过:5人阅读
header("Content-Type: text/html; charset=utf-8");$db_host='127.0.0.1';$db_host='192.168.0.22';$db_user='root';$db_pwd='';$db_name='iq1';@$mysqli=new mysqli($db_host,$db_user,$db_pwd,$db_name);if (mysqli_connect_errno()){ $str='"; printf ($str,mysqli_connect_error()); exit();};?>
header("Content-Type: text/html; charset=utf-8");
那是因为 mysqli_connect_error() 返回的信息是 gbk 的
你要 utf-8 的话就转一下码
printf ($str, iconv('gbk', 'utf-8', mysqli_connect_error()));
那是因为 mysqli_connect_error() 返回的信息是 gbk 的
你要 utf-8 的话就转一下码
printf ($str, iconv('gbk', 'utf-8', mysqli_connect_error()));
不很清楚,你有意制造些错误不就知道了那?