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
Crontab is a command used to set up periodic exec...
Problem/failure/scenario/requirement The hard dis...
Preface Usually when making h5 pages, you need to...
0. New operation: mkdir abc #Create a new folder ...
Table of contents 1. Scope 2. Function return val...
1. First, understand the overflow-wrap attribute ...
Table of contents 1. System environment 2. Operat...
I don't know if you have noticed when making a...
Configuring network connectivity for Linux system...
What is ORM? ORM stands for Object Relational Map...
Core SQL statements MySQL query statement that do...
The MySQL version used in this example is mysql-8...
Create Group Grouping is established in the GROUP...
CSS3 Patterns Gallery This CSS3 pattern library s...
I encountered a very unusual parameter garbled pro...