久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <small id='5376g'></small><noframes id='5376g'>

    <legend id='5376g'><style id='5376g'><dir id='5376g'><q id='5376g'></q></dir></style></legend>

          <bdo id='5376g'></bdo><ul id='5376g'></ul>
      1. <tfoot id='5376g'></tfoot>

        <i id='5376g'><tr id='5376g'><dt id='5376g'><q id='5376g'><span id='5376g'><b id='5376g'><form id='5376g'><ins id='5376g'></ins><ul id='5376g'></ul><sub id='5376g'></sub></form><legend id='5376g'></legend><bdo id='5376g'><pre id='5376g'><center id='5376g'></center></pre></bdo></b><th id='5376g'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='5376g'><tfoot id='5376g'></tfoot><dl id='5376g'><fieldset id='5376g'></fieldset></dl></div>
      2. 如何在命名空間中使用 MySQLi

        How to use MySQLi inside a namespace(如何在命名空間中使用 MySQLi)

          <tbody id='jk5hM'></tbody>
                <legend id='jk5hM'><style id='jk5hM'><dir id='jk5hM'><q id='jk5hM'></q></dir></style></legend>
                <tfoot id='jk5hM'></tfoot>

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

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

                  <bdo id='jk5hM'></bdo><ul id='jk5hM'></ul>
                  本文介紹了如何在命名空間中使用 MySQLi的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  MySQLi 在沒有命名空間的類內部和類外部都可以正常工作.

                  MySQLi works fine inside a class with no namespace and outside a class.

                  我最近開始使用命名空間,現在我偶然發現了一個類似于以下的代碼:

                  I recently started using namespace and now I have stumbled on a code much like the following:

                   namespace Project;
                  
                   class ProjectClass{
                  
                        public static function ProjectClassFunction{
                            $db = new mysql(data, data, data, data);
                        }
                  
                   }
                  

                  但是,它通過一條消息向我報告

                  However, it reports back to me with a message

                  致命錯誤:未找到類Projectmysqli""

                  "Fatal error: Class 'Projectmysqli' not found"

                  如何在使用命名空間的類中使用 mysqli?

                  How do I use mysqli inside a class which uses namespace?

                  推薦答案

                  默認情況下,PHP 將嘗試從您當前的命名空間加載類.引用全局命名空間中的類:

                  By default, PHP will try to load classes from your current namespace. Refer to the class in the global namespace:

                  $db = new mysqli(/* ... */);
                  

                  這與您在引用不同命名空間中的類時所做的相同:

                  This is the same thing you'd do when referring to a class in a different namespace:

                  $foo = new SomeNamespaceFoo();
                  

                  請注意,如果您不使用開頭的反斜杠,PHP 將嘗試加載相對于您當前命名空間的類.以下代碼將在名稱空間 ProjectSomeNamespace 中查找名為 Foo 的類:

                  Note that if you left off the beginning backslash, PHP would try to load the class relative to your current namespace. The following code will look in the namespace ProjectSomeNamespace for a class named Foo:

                  namespace Project;
                  $foo = new SomeNamespaceFoo();
                  

                  或者,您可以顯式導入命名空間并避免歧義:

                  Alternatively, you can explicitly import namespaces and save yourself ambiguity:

                  namespace Project;
                  
                  use Mysqli;
                  
                  class ProjectClass
                  {
                      public static function ProjectClassFunction()
                      {
                          $db = new Mysqli(/* ... */);
                      }
                  }
                  

                  這篇關于如何在命名空間中使用 MySQLi的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  store_result() and get_result() in mysql returns false(mysql 中的 store_result() 和 get_result() 返回 false)
                  Call to undefined function mysqli_result::num_rows()(調用未定義的函數 mysqli_result::num_rows())
                  PHP Prepared Statement Problems(PHP 準備好的語句問題)
                  mysqli_fetch_array returning only one result(mysqli_fetch_array 只返回一個結果)
                  PHP MySQLi Multiple Inserts(PHP MySQLi 多次插入)
                  How do I make sure that values from MySQL keep their type in PHP?(如何確保 MySQL 中的值在 PHP 中保持其類型?)

                  • <small id='fvyGw'></small><noframes id='fvyGw'>

                    <tfoot id='fvyGw'></tfoot><legend id='fvyGw'><style id='fvyGw'><dir id='fvyGw'><q id='fvyGw'></q></dir></style></legend>
                      <tbody id='fvyGw'></tbody>
                    <i id='fvyGw'><tr id='fvyGw'><dt id='fvyGw'><q id='fvyGw'><span id='fvyGw'><b id='fvyGw'><form id='fvyGw'><ins id='fvyGw'></ins><ul id='fvyGw'></ul><sub id='fvyGw'></sub></form><legend id='fvyGw'></legend><bdo id='fvyGw'><pre id='fvyGw'><center id='fvyGw'></center></pre></bdo></b><th id='fvyGw'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='fvyGw'><tfoot id='fvyGw'></tfoot><dl id='fvyGw'><fieldset id='fvyGw'></fieldset></dl></div>

                      <bdo id='fvyGw'></bdo><ul id='fvyGw'></ul>
                            主站蜘蛛池模板: 日韩电影中文字幕 | 亚洲国产精品一区 | 狠狠综合久久av一区二区老牛 | 久久久久久免费免费 | 久久综合成人精品亚洲另类欧美 | 久久久久国产精品一区三寸 | 五月婷婷 六月丁香 | 色视频网站 | 欧美亚洲一级 | av一区二区三区四区 | 免费黄色网址视频 | 成人超碰| 欧美性生活一区二区三区 | 国产成人av在线播放 | 一区二区三区免费 | 激情五月综合 | 日韩精品激情 | 免费午夜视频在线观看 | 国产午夜在线观看 | 欧美在线小视频 | 免费国产一区 | 中文字幕一区二区三区不卡在线 | 极品销魂美女一区二区 | 亚洲一区二区三区免费观看 | 日韩超碰| 亚洲专区在线 | 免费观看av | 中文字幕一区二区三区精彩视频 | 极品国产视频 | 毛片久久久 | 蜜桃视频成人 | h视频在线免费 | 草久久久| 国产福利91精品 | 激情六月丁香 | 在线观看中文字幕一区二区 | 日韩一二区| 日韩av一区二区在线观看 | 精品视频一区二区 | 久草视频在线播放 | 在线播放国产一区二区三区 |