> >

Re: PHP garbled problem, UTF-8 (garbled), very full explanation and solution.

time:14-10-07 forum:PHP tools and code
  The three.MYSQL database uses the UTF-8 coding problem

1. to create a database and data table
create a database by phpMyAdmin. E]
when the data table is created: if this field is in Chinese, you need to set "collation" to "utf8_general_ci",
if the field is to store English or number, the default is right.
corresponding SQL statements, such as

[code]CREATE TABLE `test` (
`id` INT NOT NULL) After that:
[hide]$connection = mysql_connect ($host_name, $host_user, $host_pass);
add two rows:
[code]
mysql_query (
  • 1
  • 2
  • 3
  • 4
  • 5

prev:PHP code instance for importing SQL scri... next:PHP reads all the same types of files un...
post comments
Notice



Approved   Where is the old Ji'nan? More than 3...   A small set of fingers can adjust th...   In the mountains, after 80 years hai...   The General Administration of food a...   She turned the "abnormal" into a win...
rand   PHP code shields China's IP address   PHP error Warning: Cannot modify hea...   PHP does not use the iconv () functi...   PHP does not use iconv () function U...   Conversion of GB2312 and Unicode cod...
ads

other

Because all the contents of this site are reproduced from other media, the intention is to provide free services to the public, but it does not mean that this site agrees with its views, and can not be responsible for the authenticity of its verification, such as the copyright unit or individual of the manuscript does not want to publish on this site, please Contact me, I will immediately remove it, thank you. Contact: atseashawk@163.com