Mysqli_query (& ldquo; set nams utf8 & rdquo;) is FALSE, mysqli_querynams

Source: Internet
Author: User

Mysqli_query ("set nams utf8") is FALSE, mysqli_querynams

Tested:

Mysqli_query ("set nams utf8") must be executed before all statements are executed; otherwise, FALSE is returned.

 

Read the manual and say that we do not recommend using mysqli_query to set encoding and mysqli_set_charset. However, if you use this method, you must: If you use this method on Windows, mySQL client library 4.1.11 or later is required, and MySQL version is 5.0.6 or later.

What is the difference between the MySQL client library and the MySQL version? I haven't figured out yet.

 

Utf8 cannot be written as UTF-8, because MySQL command mode can only recognize "utf8" and cannot recognize "UTF-8". However, "-" must be added to the header in PHP. this is because IE does not know the "utf8 ".

 

"UTF-8" is the standard writing, the English below Windows is not case sensitive, so you can also write "UTF-8 ". It is best to write in uppercase according to the standard.

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.