时间:2021-07-01 10:21:17 帮助过:8人阅读
<?php $mysqli = new mysqli(‘localhost‘, ‘root‘, ‘‘, ‘w‘); if(mysqli_connect_errno()){ printf(‘Connect failed: %s\n‘, mysqli_connect_errno()); exit(); } if(!$mysqli->set_charset(‘utf8‘))echo $mysqli->error;
if(!$mysqli->set_charset(‘2utf8‘))echo $mysqli->error; //Invalid characterset or character set not supported if(!$mysqli->set_charset(‘utf-8‘))echo $mysqli->error; //Invalid characterset or character set not supported if(!$mysqli->set_charset(‘UTF-8‘))echo $mysqli->error; //Invalid characterset or character set not supported
debug $mysqli->character_set_name();
标签: