pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

<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="djzrpn7" 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="5vdxvlf" 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="xv7jtht" id='mohtN'><tfoot id='mohtN'></tfoot><dl id='mohtN'><fieldset id='mohtN'></fieldset></dl></div>
                          主站蜘蛛池模板: 对夹式止回阀_对夹式蝶形止回阀_对夹式软密封止回阀_超薄型止回阀_不锈钢底阀-温州上炬阀门科技有限公司 | 广东风淋室_广东风淋室厂家_广东风淋室价格_广州开源_传递窗_FFU-广州开源净化科技有限公司 | 菲希尔X射线测厚仪-菲希尔库伦法测厚仪-无锡骏展仪器有限责任公司 | 减速机三参数组合探头|TSM803|壁挂式氧化锆分析仪探头-安徽鹏宸电气有限公司 | 点胶机_点胶阀_自动点胶机_智能点胶机_喷胶机_点胶机厂家【欧力克斯】 | 等离子表面处理机-等离子表面活化机-真空等离子清洗机-深圳市东信高科自动化设备有限公司 | FFU_空气初效|中效|高效过滤器_空调过滤网-广州梓净净化设备有限公司 | 广州中央空调回收,二手中央空调回收,旧空调回收,制冷设备回收,冷气机组回收公司-广州益夫制冷设备回收公司 | 不干胶标签-不干胶贴纸-不干胶标签定制-不干胶标签印刷厂-弗雷曼纸业(苏州)有限公司 | 工业用品一站式采购平台|南创工品汇-官网|广州南创 | 二手Sciex液质联用仪-岛津气质联用仪-二手安捷伦气质联用仪-上海隐智科学仪器有限公司 | 西安耀程造价培训机构_工程预算实训_广联达实作实操培训 | 维泰克Veertek-锂电池微短路检测_锂电池腐蚀检测_锂电池漏液检测 | FAG轴承,苏州FAG轴承,德国FAG轴承-恩梯必传动设备(苏州)有限公司 | 升降机-高空作业车租赁-蜘蛛车-曲臂式伸缩臂剪叉式液压升降平台-脚手架-【普雷斯特公司厂家】 | 不锈钢轴流风机,不锈钢电机-许昌光维防爆电机有限公司(原许昌光维特种电机技术有限公司) | 【灵硕展览集团】展台展会设计_展览会展台搭建_展览展示设计一站式服务公司 | 日本细胞免疫疗法_肿瘤免疫治疗_NK细胞疗法 - 免疫密码 | 西装定制/做厂家/公司_西装订做/制价格/费用-北京圣达信西装 | 纸箱网 -纸箱机械|设备|包装纸盒|包装印刷行业门户网站 | 稳尚教育加盟-打造高考志愿填报平台_新高考志愿填报加盟_学业生涯规划加盟 | 水篦子|雨篦子|镀锌格栅雨水篦子|不锈钢排水篦子|地下车库水箅子—安平县云航丝网制品厂 | 上海物流公司,上海货运公司,上海物流专线-优骐物流公司 | 慈溪麦田广告公司,提供慈溪广告设计。 | 丙烷/液氧/液氮气化器,丙烷/液氧/液氮汽化器-无锡舍勒能源科技有限公司 | 森旺-A级防火板_石英纤维板_不燃抗菌板装饰板_医疗板 | 手表腕表维修保养鉴定售后服务中心网点 - 名表维修保养 | 内窥镜-工业内窥镜厂家【上海修远仪器仪表有限公司】 | 天津次氯酸钠酸钙溶液-天津氢氧化钠厂家-天津市辅仁化工有限公司 | 自进式锚杆-自钻式中空注浆锚杆-洛阳恒诺锚固锚杆生产厂家 | 合肥防火门窗/隔断_合肥防火卷帘门厂家_安徽耐火窗_良万消防设备有限公司 | 全自动包装秤_全自动上袋机_全自动套袋机_高位码垛机_全自动包装码垛系统生产线-三维汉界机器(山东)股份有限公司 | 档案密集架,移动密集架,手摇式密集架,吉林档案密集架-厂家直销★价格公道★质量保证 | RFID电子标签厂家-上海尼太普电子有限公司 | 撕碎机_轮胎破碎机_粉碎机_回收生产线厂家_东莞华达机械有限公司 | 至顶网| 石家庄救护车出租_重症转院_跨省跨境医疗转送_活动赛事医疗保障_康复出院_放弃治疗_腾康26年医疗护送转诊团队 | 布袋除尘器|除尘器设备|除尘布袋|除尘设备_诺和环保设备 | 垃圾清运公司_环卫保洁公司_市政道路保洁公司-华富环境 | 细石混凝土泵_厂家_价格-烟台九达机械有限公司 | 二手注塑机回收_旧注塑机回收_二手注塑机买卖 - 大鑫二手注塑机 二手光谱仪维修-德国OBLF光谱仪|进口斯派克光谱仪-热电ARL光谱仪-意大利GNR光谱仪-永晖检测 |