Debug $mysqli->character_set_name ();

Source: Internet
Author: User

<?PHP$mysqli=NewMysqli (' localhost ', ' root ', ' ', ' W '));if(Mysqli_connect_errno()){    printf(' Connect failed:%s\n ',Mysqli_connect_errno()); Exit();}$charset=$mysqli->character_set_name ();//Initial Character Set//latin1//sets the default character set to is used when sending data from and to the database s Erver. BOOLif($charset!== ' UTF8 ')$mysqli->set_charset (' UTF8 ');$charset=$mysqli->character_set_name ();//Current Character Set//utf8

<? PHP $mysqli new mysqli (' localhost ', ' root ', ' ', ' W '); if (Mysqli_connect_errno()) {    printfmysqli_connect_errno());     Exit ();} if (! $mysqli->set_charset (' UTF8 '))echo$mysqli->error;
if(!$mysqli->set_charset (' 2utf8 '))Echo $mysqli->error;//Invalid characterset or character set not supportedif(!$mysqli->set_charset (' Utf-8 '))Echo $mysqli->error;//Invalid characterset or character set not supportedif(!$mysqli->set_charset (' UTF-8 '))Echo $mysqli->error;//Invalid characterset or character set not supported

Debug $mysqli->character_set_name ();

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.