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.