Home > Article > Backend Development > Solution to Chinese garbled code in php connection to mysql
This article introduces the solution to Chinese garbled characters when PHP connects to MySQL data. Friends in need can refer to it.
Solution to Chinese garbled characters: 1. When creating the database, select utf-8 encoding 2. Select UTF-8 encoding when creating php files 3. Prevent garbled characters during data transmission mysql_query('set names utf8');4. Add: to the static page: Generally, if the above four points are set, there will be basically no problem. |