我在使 mydatabase 表显示拉丁字符时遇到问题。(\xc3\xa3、\xc3\xb5、\xc3\xa1、\xc3\xa9、\xc3\xad、\xe2\x80\xa6)。我正在使用带有 Apache 2.4.9 和 MySQL 5.6.17 的 WAMP 服务器。
\n\n我有一个用 HTML 创建的简单表单,并且有一个 PHP 代码,运行查询并创建帐户。这是 PHP 代码:
\n\ninclude(\'config.php\'); //My database data for connection\n\nif(isset($_POST[\'submit\'])) {\n $username = $_POST[\'username\'];\n $password = $_POST[\'password\'];\n $email = $_POST[\'email\'];\n\n $query = "INSERT INTO account SET username = \'".$username."\', password = PASSWORD(\'".$password."\'), email = \'".$email."\'";\n $execute_query = mysqli_query($connection, $query);\n if($execute_query) { \n //Creates the account\n }\n else { \n //If an error occures\n }\n}\nRun Code Online (Sandbox Code Playgroud)\n\n例如,现在我创建一个帐户:
\n\nUsername: Lu\xc3\xads\nPassword: 1234\nE-mail: somemail@mail.com\nRun Code Online (Sandbox Code Playgroud)\n\n当我检查表时,它显示创建的帐户,但用户名显示Lu\xc3\x83s …