我想问一下为什么下面显示的代码不能将汉字插入$split 5
MySQL db。我也创建了一个db
usingutf8_general_ci
和 table。
$mysqli = new mysqli($GLOBALS["mysql_host"], $GLOBALS["mysql_user"], $GLOBALS["mysql_passwd"], $GLOBALS["mysql_database"]);
$stmt = mysql_query("SET character_set_results 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8");
$stmt = $mysqli->prepare("INSERT INTO cell (`add`) VALUES (?)");
$stmt->bind_param("s", $split[5]);
$stmt->execute();
$stmt->close();
$mysqli->close();