<bdo id='mPflk'></bdo><ul id='mPflk'></ul>

  • <legend id='mPflk'><style id='mPflk'><dir id='mPflk'><q id='mPflk'></q></dir></style></legend><tfoot id='mPflk'></tfoot>

      <small id='mPflk'></small><noframes id='mPflk'>

      <i id='mPflk'><tr id='mPflk'><dt id='mPflk'><q id='mPflk'><span id='mPflk'><b id='mPflk'><form id='mPflk'><ins id='mPflk'></ins><ul id='mPflk'></ul><sub id='mPflk'></sub></form><legend id='mPflk'></legend><bdo id='mPflk'><pre id='mPflk'><center id='mPflk'></center></pre></bdo></b><th id='mPflk'></th></span></q></dt></tr></i><div id='mPflk'><tfoot id='mPflk'></tfoot><dl id='mPflk'><fieldset id='mPflk'></fieldset></dl></div>

      1. utf 8 - PHP 和 MySQLi UTF8

        时间:2023-07-30

          • <bdo id='yRAqx'></bdo><ul id='yRAqx'></ul>

            <small id='yRAqx'></small><noframes id='yRAqx'>

                <tbody id='yRAqx'></tbody>

              <i id='yRAqx'><tr id='yRAqx'><dt id='yRAqx'><q id='yRAqx'><span id='yRAqx'><b id='yRAqx'><form id='yRAqx'><ins id='yRAqx'></ins><ul id='yRAqx'></ul><sub id='yRAqx'></sub></form><legend id='yRAqx'></legend><bdo id='yRAqx'><pre id='yRAqx'><center id='yRAqx'></center></pre></bdo></b><th id='yRAqx'></th></span></q></dt></tr></i><div id='yRAqx'><tfoot id='yRAqx'></tfoot><dl id='yRAqx'><fieldset id='yRAqx'></fieldset></dl></div>
            1. <tfoot id='yRAqx'></tfoot>
            2. <legend id='yRAqx'><style id='yRAqx'><dir id='yRAqx'><q id='yRAqx'></q></dir></style></legend>

                  本文介绍了utf 8 - PHP 和 MySQLi UTF8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我的表字符集是 utf8,它的排序规则是 utf8.现在我有这个代码:

                  my table char set is utf8 and it's collation is utf8.now i have this code:

                     $mysqli = new mysqli("localhost", "root", "", "Amoozeshgah");
                  
                              if (mysqli_connect_errno()) {
                                    printf("Connect failed: %s
                  ", mysqli_connect_error());
                  
                              }
                            if (!$mysqli->set_charset("utf8")) {
                      printf("Error loading character set utf8: %s
                  ", $mysqli->error);
                  } else {
                      printf("Current character set: %s
                  ", $mysqli->character_set_name());
                  }
                          mysql_set_charset('utf8');
                              if ($stmt = $mysqli->prepare("SELECT About_Title FROM Tbl_About WHERE About_Id=?")) {
                                  $city = 8;
                  
                                 /* bind parameters for markers */
                                  $stmt->bind_param("s", $city);
                  
                                /* execute query */
                                  $stmt->execute();
                  
                                 /* bind result variables */
                  
                                    $result = $stmt->get_result();
                  
                               /* fetch value */
                              while ($myrow = $result->fetch_assoc()) {
                  
                          // use your $myrow array as you would with any other fetch
                          printf("%s is in district %s
                  ", $city, $myrow['About_Title']);
                          print("shod");
                  
                      }
                  

                  但输出是:

                  Current character set: utf8 8 is in district نتمنتشس shod
                  

                  我能做什么?我换了:

                  if (!$mysqli->set_charset("utf8")) {
                          printf("Error loading character set utf8: %s
                  ", $mysqli->error);
                      } else {
                          printf("Current character set: %s
                  ", $mysqli->character_set_name());
                      }
                              mysql_set_charset('utf8');
                  

                  $mysqli->set_charset("utf8")
                  

                  但没有区别.

                  推荐答案

                  请将 mysql_set_charset('utf8'); 替换为 $mysqli->set_charset("utf8")代码> :-)

                  Please replace mysql_set_charset('utf8'); to $mysqli->set_charset("utf8") :-)

                  这篇关于utf 8 - PHP 和 MySQLi UTF8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:带数组的准备语句 下一篇:准备好的语句 - 行数

                  相关文章

                  最新文章

                    <small id='1vCRX'></small><noframes id='1vCRX'>

                  1. <legend id='1vCRX'><style id='1vCRX'><dir id='1vCRX'><q id='1vCRX'></q></dir></style></legend>
                    <tfoot id='1vCRX'></tfoot>
                  2. <i id='1vCRX'><tr id='1vCRX'><dt id='1vCRX'><q id='1vCRX'><span id='1vCRX'><b id='1vCRX'><form id='1vCRX'><ins id='1vCRX'></ins><ul id='1vCRX'></ul><sub id='1vCRX'></sub></form><legend id='1vCRX'></legend><bdo id='1vCRX'><pre id='1vCRX'><center id='1vCRX'></center></pre></bdo></b><th id='1vCRX'></th></span></q></dt></tr></i><div id='1vCRX'><tfoot id='1vCRX'></tfoot><dl id='1vCRX'><fieldset id='1vCRX'></fieldset></dl></div>
                      • <bdo id='1vCRX'></bdo><ul id='1vCRX'></ul>