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

<tfoot id='KN2CB'></tfoot>

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

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

      何時以及為何使用 mysqli_fetch_row、mysqli_fetch_obje

      When and why to use mysqli_fetch_row, mysqli_fetch_object, mysqli_fetch_assoc, mysqli_fetch_array(何時以及為何使用 mysqli_fetch_row、mysqli_fetch_object、mysqli_fetch_assoc、mysqli_fetch_array) - IT屋-程序員軟件開發技術分

        1. <tfoot id='KHuB3'></tfoot>
        2. <small id='KHuB3'></small><noframes id='KHuB3'>

          <legend id='KHuB3'><style id='KHuB3'><dir id='KHuB3'><q id='KHuB3'></q></dir></style></legend>
            <tbody id='KHuB3'></tbody>
            <bdo id='KHuB3'></bdo><ul id='KHuB3'></ul>
                <i id='KHuB3'><tr id='KHuB3'><dt id='KHuB3'><q id='KHuB3'><span id='KHuB3'><b id='KHuB3'><form id='KHuB3'><ins id='KHuB3'></ins><ul id='KHuB3'></ul><sub id='KHuB3'></sub></form><legend id='KHuB3'></legend><bdo id='KHuB3'><pre id='KHuB3'><center id='KHuB3'></center></pre></bdo></b><th id='KHuB3'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='KHuB3'><tfoot id='KHuB3'></tfoot><dl id='KHuB3'><fieldset id='KHuB3'></fieldset></dl></div>
              1. 本文介紹了何時以及為何使用 mysqli_fetch_row、mysqli_fetch_object、mysqli_fetch_assoc、mysqli_fetch_array的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我在某種程度上理解 mysqli_fetch_rowmysqli_fetch_objectmysqli_fetch_assocmysqli_fetch_array 之間的區別.

                I understand in some way the differences between mysqli_fetch_row, mysqli_fetch_object, mysqli_fetch_assoc and mysqli_fetch_array.

                我的問題是它們是否如此相似(如果它們真的像許多主題所說的幾乎相同)我們應該使用哪個?為什么我們要使用首選的,是否有一些性能差異?

                My question is if they are so similar (if they are really almost the same as many topics say) which should we use? Why should we use the preferred one and is there some performance difference?

                我讀過一些人說永遠不要使用 mysqli_fetch_array.我很迷惑.我現在正在閱讀一些 PHP 書籍,所有示例都包含它.如果這是不正確的,我在鍛煉時停止使用它并使用您可以解釋和推薦的其他東西更好嗎?

                I have read some people say never to use mysqli_fetch_array. I am confused. I am reading now some PHP books and all the examples include it. If this is incorrect is it better for me to stop using it while exercising and use something else that you could explain and recommend?

                我也讀到這些是相等的:

                I have also read that these are equal:

                mysqli_fetch_array( $result, MYSQLI_ASSOC ) = mysqli_fetch_assoc( $result ) 
                mysqli_fetch_array( $result, MYSQLI_NUM ) = mysqli_fetch_row( $result )
                mysqli_fetch_array ( $result ) = mysqli_fetch_assoc( $result ) + mysqli_fetch_row( $result )
                

                如果它們在概念上是相同的,是否存在性能差異?我們應該使用哪個?差異是出于性能原因還是為了開發人員的方便?

                If they are equal as a concept, are there performance differences? Which should we use? Are the differences because of performance reasons or for the developer's convenience?

                我堅信這些差異有很大的原因,它們有不同的用法和案例,但我找不到在哪里使用不同的函數和語法.

                I strongly believe that these differences have a big reason and they have different usage and cases, but I cannot find where to use different functions and syntax.

                推薦答案

                php.net 文檔中的這些行是關鍵:

                These lines from the documentation on php.net are key:

                mysqli_fetch_array() 是 mysqli_fetch_row() 的擴展版本功能.除了將數據存儲在數字索引中結果數組,mysqli_fetch_array() 函數也可以存儲關聯索引中的數據,使用結果集的字段名稱作為鑰匙.

                mysqli_fetch_array() is an extended version of the mysqli_fetch_row() function. In addition to storing the data in the numeric indices of the result array, the mysqli_fetch_array() function can also store the data in associative indices, using the field names of the result set as keys.

                http://www.php.net/manual/en/mysqli-result.fetch-array.php

                如果兩列或更多列具有相同的名稱,則引用該列第一次出現的唯一方法是通過數字索引.在這些情況下,您需要 mysqli_fetch_rowmysqli_fetch_arrayMYSQLI_BOTHMYSQLI_NUM 作為第二個參數(在程序使用中).

                In cases where two or more columns have the same name the only way to reference the first occurence(s) of that column is by numerical index. In these cases you need mysqli_fetch_row or mysqli_fetch_array with either MYSQLI_BOTH or MYSQLI_NUM as its second argument (in procedural usage).

                mysqli_fetch_assoc($result) 只是 mysqli_fetch_array($result, MYSQLI_ASSOC) 的簡寫.

                mysqli_fetch_object 符合您的預期:它將一行結果作為對象返回.在 mysqli_fetch_assoc 上使用這個是一個對象或數組是否更好地代表正在處理的記錄的問題.該對象可以是您想要的任何類 - stdClass 是默認值.

                mysqli_fetch_object does what you expect: It returns a row of results as an object. Use of this over mysqli_fetch_assoc is a matter of whether an object or an array better represents the record being handled. The object can be of whatever class you want - stdClass is the default.

                這篇關于何時以及為何使用 mysqli_fetch_row、mysqli_fetch_object、mysqli_fetch_assoc、mysqli_fetch_array的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                相關文檔推薦

                Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                PHP PDO ODBC connection(PHP PDO ODBC 連接)
                Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)
                <legend id='mohtN'><style id='mohtN'><dir id='mohtN'><q id='mohtN'></q></dir></style></legend>
                  <tbody id='mohtN'></tbody>

                  <tfoot id='mohtN'></tfoot>

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

                        • <bdo id='mohtN'></bdo><ul id='mohtN'></ul>
                          <i id='mohtN'><tr id='mohtN'><dt id='mohtN'><q id='mohtN'><span id='mohtN'><b id='mohtN'><form id='mohtN'><ins id='mohtN'></ins><ul id='mohtN'></ul><sub id='mohtN'></sub></form><legend id='mohtN'></legend><bdo id='mohtN'><pre id='mohtN'><center id='mohtN'></center></pre></bdo></b><th id='mohtN'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='mohtN'><tfoot id='mohtN'></tfoot><dl id='mohtN'><fieldset id='mohtN'></fieldset></dl></div>
                          主站蜘蛛池模板: 中文字幕免费在线 | 欧美大片久久久 | а_天堂中文最新版地址 | 成人妇女免费播放久久久 | 久久高清免费视频 | 国产精品久久毛片av大全日韩 | 免费黄色av| 久久国产精品久久久久久 | 亚洲成a人片 | 一级欧美一级日韩片 | 麻豆精品久久久 | 国产九九精品视频 | 色在线免费 | 一区二区手机在线 | 97视频网站 | 亚洲国产黄色av | 日韩最新网址 | 99久久日韩精品免费热麻豆美女 | 久久久毛片 | 精品视频在线观看 | 精产国产伦理一二三区 | 一级一级毛片免费看 | 国产 亚洲 网红 主播 | 久久免费精品 | 亚洲精品一区二区三区中文字幕 | 天天操夜夜操 | 在线一区| 免费爱爱视频 | 亚洲精品国产综合区久久久久久久 | 国产一区二区在线免费 | 男人视频网站 | 天天草夜夜骑 | 日本在线免费观看 | 天天拍天天操 | 日韩一区二区在线视频 | 欧美日韩专区 | 一区二区欧美在线 | 欧美日韩高清在线一区 | 免费a网站 | 一区二区三区在线播放 | 99精品欧美一区二区三区综合在线 |