Mysqli_query ("Set NAMs UTF8") is false

Source: Internet
Author: User
Tags mysql version

Tested:

Mysqli_query ("Set nams UTF8") must return false before all statements are executed.

Look at the manual, said not recommended to use Mysqli_query to set the code, with Mysqli_set_charset, but if this method is required: If you use this method on the Windows platform, Requires 4.1.11 version or more of the MySQL client library, and the MySQL version is 5.0.6 or more.

What's the difference between MySQL client library and MySQL version, I haven't figured it out yet.

UTF8 can not be written utf-8, because the MySQL command mode can only identify "UTF8", do not recognize the "utf-8", but in PHP header to add "-", because IE does not know the "UTF8" without the bar.

"UTF-8" is the standard way of writing, English is not case-sensitive under windows, so it can also be written as "Utf-8". It is best to write in the standard, written in uppercase.

Mysqli_query ("Set NAMs UTF8") is false

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.