Find the problem I recently encountered a problem at work. When creating a table in MySQL database, latin character set was used, while utf-8 was used for querying on the web page. When Chinese characters were entered on the input page and then queried in the database, SET collation_connection = 'utf8_general_ci' Note: Replace the following two sentences with your database name and your data table name ALTER DATABASE your_database_name CHARACTER SET utf8 COLLATE utf8_general_ci ALTER TABLE your_table_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci This ensures that the database is also in the UTF-8 character set, so there will be no errors when querying the contents of the database when Chinese is input. reference: Illegal mix of collations MySQL Error Set the database character set to utf-8 in PHP mysqli_set_charset($dbc,'utf8'); Just add meta to display utf-8 in HTML <meta charset="utf-8"> Summarize Well, the above is the full content of this article. I hope that the content of this article can bring some help to your study or work. If you have any questions, you can leave a message to communicate. Thank you for your support of 123WORDPRESS.COM. You may also be interested in:
|
<<: React error boundary component processing
>>: Use nginx.vim tool for syntax highlighting and formatting configuration nginx.conf file
When MySQL performs DDL operations such as alter ...
I don't expect to be an expert DBA, but when ...
I've been using redis recently and I find it ...
Table of contents Preface 1. Download MySQL 8.0.2...
The following error occurred while installing the...
1. AIDE AIDE (Advanced Intrusion Detection Enviro...
Table of contents 1. Configure Vue front end 1. D...
Preface: Speaking of sandboxes, our minds may ref...
In design work, I often hear designers participati...
How to solve VMware workstation virtual machine c...
Vim is a powerful full-screen text editor and the...
Install the required environment 1. gcc installat...
Docker daemon socket The Docker daemon can listen...
Table of contents Preface Standard sfc writing me...
How to install flash in Linux 1. Visit the flash ...