repinted: http://blog.csdn.net/class1/archive/2006/12/30/1469298.aspxIn order for your Web page to display properly on more servers, add "SET NAMES UTF8". (You can choose the appropriate encoding according to your preference, such as gb2312) , even
We often use the"Set names utf8", Why is this sentence added?CodeCan this be solved? Next, let's dive into the internal execution principle of set names utf8.
Let's talk about the character set of MySQL. In Windows, you can modify PHP code
[MySQL]
Mysql statement: set names UTF8 has always known only mysql_query ("set names UTF8"); it sets the database encoding, but it has never been clear what "set names UTF8" is. It is not until today that the set names... is a mysql statement. I really
To prevent garbled characters, I'm setting up several character sets for DB:
mysqli_query($db,"SET NAMES UTF8"); mysqli_query($db,"set character_set_client=utf8"); mysqli_query($db,"set character_set_connection=utf8");
Write it down first, so that you won't be able to remember it again!
When using PHP to operate the database, the data in the database is UTF-8 encoded. when reading the data, all the information displayed is ??????? The question mark is garbled. I
Write it down before you can find it again!
When PHP operates the database, the data in the database uses UTF8 encoding, and when it is read out, it shows all the??????? The question mark garbled, looked for some data originally is before reads
Let's first assume that the code used in the database is UTF-8
In the PHP page we should first add
Copy CodeThe code is as follows:
The value Utf-8 here charset must be the same as the encoding type when the file is saved
Before database
We first assume that the encoding used in the database is UTF-8In this case we should first add the PHP page
Copy Code code as follows:
The value Utf-8 here charset must be the same as the encoding type when the file is saved
The encoding (character set) problem between MySQL and Apache makes me suffer. The solution to these problems on the internet is relatively fragmented and one-sided. Most of the solutions are provided, but they do not tell why. So I will
The
PHP connection MySQL Query result Chinese display garbled solution. Let's assume that the encoding used in the database is UTF-8, then we should first add the Copy code in the PHP page as follows: metahttp-equivContent-Typecontenttexthtml; we first
Suddenly found a little busy this week-PHP advanced hi
Tuesday, but I suddenly realized that this week was a bit busy and I was still looking forward to it. I went to the city this afternoon and came back to watch a movie at night. I had a hot pot
Hi
Tuesday only, but I suddenly realized that this week is a bit busy to play the feeling, still very much looking forward to--this afternoon to the city, come back to watch movies in the Evening, tomorrow night to eat hot pot, the day after
I suddenly found myself busy this week .. Playing-PHP advanced, a little busy-php. I suddenly found myself busy this week .. Playing-PHP advanced, a little busy-phphi was only available on Tuesday, but I suddenly realized that this week was a little
Http://hzaufarm.tk/index.php/topic,7.0.html
I believe that many of my friends will keep a close eye on character encoding, but this is a big headache when garbled code occurs. This article, based on the experience of our predecessors and the
To enable the normal display of Your webpage on more servers, add "set names utf8 ".
Repinted: http://blog.csdn.net/class1/archive/2006/12/30/1469298.aspxTo enable normal display of Your webpage on more servers, add "set names utf8" (you
Query (' SELECT * from Pw_bbs_threads '), while ($row = $rs->fetch ()) {Print_r ($row);}
1. File Encoding UTF8
2.mysql encoded UTF8
3. Browser Encoding UTF8
Search a lot, found that someone said to set names UTF8, but in my this code do not know
Suddenly found this week a little busy. Playing-php advanced, a little busy-php
Hi
Tuesday only, but I suddenly realized that this week is a bit busy to play the feeling, still very much looking forward to--this afternoon to the city, come back to
This article mainly introduces how the MySQLdb and torndb modules in Python handle MySQL disconnection issues. torndb is more concise to use, for more information about how to use python to refine the wordpress tag code, see the error when calling
The PHP code is as follows:
echo "ISBN: ". $isbn."Title: ". $name."Author: ". $author."";
The data is obtained from the database and then assigned to $ISBN.
Garbled display
Add code:
echo "
";
After:
How to solve Ah??
Reply to
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.