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

  • <legend id='NYYYG'><style id='NYYYG'><dir id='NYYYG'><q id='NYYYG'></q></dir></style></legend>

  • <tfoot id='NYYYG'></tfoot>

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

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

      1. <small id='NYYYG'></small><noframes id='NYYYG'>

      2. mysqli_store_result() 與 mysqli_use_result()

        mysqli_store_result() vs. mysqli_use_result()(mysqli_store_result() 與 mysqli_use_result())

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

          <tfoot id='fhBNE'></tfoot>
                <tbody id='fhBNE'></tbody>
            • <legend id='fhBNE'><style id='fhBNE'><dir id='fhBNE'><q id='fhBNE'></q></dir></style></legend>
                <bdo id='fhBNE'></bdo><ul id='fhBNE'></ul>

                1. <i id='fhBNE'><tr id='fhBNE'><dt id='fhBNE'><q id='fhBNE'><span id='fhBNE'><b id='fhBNE'><form id='fhBNE'><ins id='fhBNE'></ins><ul id='fhBNE'></ul><sub id='fhBNE'></sub></form><legend id='fhBNE'></legend><bdo id='fhBNE'><pre id='fhBNE'><center id='fhBNE'></center></pre></bdo></b><th id='fhBNE'></th></span></q></dt></tr></i><div class="wgeoww0" id='fhBNE'><tfoot id='fhBNE'></tfoot><dl id='fhBNE'><fieldset id='fhBNE'></fieldset></dl></div>
                  本文介紹了mysqli_store_result() 與 mysqli_use_result()的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  mysqli::store_result()mysqli::use_result()?

                  PHP.net 上的文檔似乎對兩者之間的區(qū)別非常模糊.mysqli::use_result()-page 不提供任何代碼示例,并將您鏈接到 mysqli::multi_query()-page 來查找它們.在該頁面中給出了以下代碼示例(完整代碼請參見頁面):

                  The documentation on PHP.net seems very vague about the difference between the two. The mysqli::use_result()-page does not offer any code-samples, and links you to the mysqli::multi_query()-page to look for them. In that page the following code-sample is given (see the page for the full code):

                  /* store first result set */
                  if ($result = $mysqli->store_result()) {
                      while ($row = $result->fetch_row()) {
                          printf("%s
                  ", $row[0]);
                      }
                      $result->free();
                  }
                  /* print divider */
                  if ($mysqli->more_results()) {
                      printf("-----------------
                  ");
                  }
                  

                  mysqli::store_result()頁面使用完全相同的代碼示例,只有一個例外:

                  The mysqli::store_result()-page uses exactly the same code-sample, with one exception:

                  /* store first result set */
                  if ($result = $mysqli->use_result()) {
                  

                  是的... store_result 變成了 use_result.請注意,即使上面的評論仍在說商店".

                  Yeah... store_result became use_result. Note that even the comment above is still saying "store".

                  看過代碼示例后,我想;好吧,所以它是一個別名".可是等等!文檔給出了以下描述:

                  Having seen the code samples, I thought; "all right, so it's an alias". But wait! The documentation gives the following descriptions:

                  • mysqli_store_result — 傳輸上次查詢的結(jié)果集
                  • mysqli_use_result — 啟動結(jié)果集檢索
                  • mysqli_store_result — Transfers a result set from the last query
                  • mysqli_use_result — Initiate a result set retrieval

                  它們看起來像是兩種不同的東西,根本不像別名.仔細觀察,我發(fā)現(xiàn) mysqli 的代碼示例中還有另一個異常::use_result()-page: $result->free(); 變成了 $result->close();.然而,我查明真相的希望很快就破滅了,當我發(fā)現(xiàn)在第二個代碼示例(程序等效)的同一頁面上,使用了 mysqli_free_result($result); 而不是預(yù)期的 mysqli_close_result($result);.

                  They seem like two different things, and are not brought like aliases at all. Taking a closer look I found out that there was yet another exception in the code-sample of the mysqli::use_result()-page: $result->free(); became $result->close();. However my hopes for finding out the truth were soon after shattered, when I found that on that same page in the second code sample (the procedural equivalent), mysqli_free_result($result); was used, and not the expected mysqli_close_result($result);.

                  推薦答案

                  mysqli::store_result() 將從 MySQL 服務(wù)器獲取整個結(jié)果集,而 mysqli::use_result() 將一一獲取行.

                  mysqli::store_result() will fetch the whole resultset from the MySQL server while mysqli::use_result() will fetch the rows one by one.

                  您鏈接到的 mysqli::use_result 文檔中也提到了這一點:

                  This is also mentioned in the mysqli::use_result docs you linked to:

                  mysqli_use_result() 函數(shù)不會從數(shù)據(jù)庫傳輸整個結(jié)果集,因此不能使用諸如 mysqli_data_seek() 之類的函數(shù)移動到集中的特定行.要使用此功能,必須使用 mysqli_store_result() 存儲結(jié)果集.如果在客戶端執(zhí)行大量處理,則不應(yīng)使用 mysqli_use_result(),因為這會占用服務(wù)器并阻止其他線程更新任何從中獲取數(shù)據(jù)的表.

                  The mysqli_use_result() function does not transfer the entire result set from the database and hence cannot be used functions such as mysqli_data_seek() to move to a particular row within the set. To use this functionality, the result set must be stored using mysqli_store_result(). One should not use mysqli_use_result() if a lot of processing on the client side is performed, since this will tie up the server and prevent other threads from updating any tables from which the data is being fetched.

                  您通常可以始終使用 mysqli::store_result() 除非您有充分的理由不一次從服務(wù)器讀取所有行.

                  You can usually always use mysqli::store_result() unless you have a good reason for not reading all rows from the server at once.

                  這篇關(guān)于mysqli_store_result() 與 mysqli_use_result()的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

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

                  • <tfoot id='jlEhb'></tfoot>

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

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

                            <tbody id='jlEhb'></tbody>
                        1. <legend id='jlEhb'><style id='jlEhb'><dir id='jlEhb'><q id='jlEhb'></q></dir></style></legend>
                          1. <i id='jlEhb'><tr id='jlEhb'><dt id='jlEhb'><q id='jlEhb'><span id='jlEhb'><b id='jlEhb'><form id='jlEhb'><ins id='jlEhb'></ins><ul id='jlEhb'></ul><sub id='jlEhb'></sub></form><legend id='jlEhb'></legend><bdo id='jlEhb'><pre id='jlEhb'><center id='jlEhb'></center></pre></bdo></b><th id='jlEhb'></th></span></q></dt></tr></i><div class="kum8qmy" id='jlEhb'><tfoot id='jlEhb'></tfoot><dl id='jlEhb'><fieldset id='jlEhb'></fieldset></dl></div>
                            主站蜘蛛池模板: 昆明化妆培训-纹绣美甲-美容美牙培训-昆明博澜培训学校 | 皮带输送机-大倾角皮带输送机-皮带输送机厂家-河南坤威机械 | 翰香原枣子坊加盟费多少钱-正宗枣核糕配方培训利润高飘香 | 河南卓美创业科技有限公司-河南卓美防雷公司-防雷接地-防雷工程-重庆避雷针-避雷器-防雷检测-避雷带-避雷针-避雷塔、机房防雷、古建筑防雷等-山西防雷公司 | 水热合成反应釜-防爆高压消解罐-西安常仪仪器设备有限公司 | 广西绿桂涂料--承接隔热涂料、隔音涂料、真石漆、多彩仿石漆等涂料工程双包施工 | 太空舱_民宿太空舱厂家_移动房屋太空舱价格-豪品建筑 | 工业插头-工业插头插座【厂家】-温州罗曼电气| 今日娱乐圈——影视剧集_八卦娱乐_明星八卦_最新娱乐八卦新闻 | 永嘉县奥阳陶瓷阀门有限公司 | 温控器生产厂家-提供温度开关/热保护器定制与批发-惠州市华恺威电子科技有限公司 | SPC工作站-连杆综合检具-表盘气动量仪-内孔缺陷检测仪-杭州朗多检测仪器有限公司 | 拉力机-拉力试验机-万能试验机-电子拉力机-拉伸试验机-剥离强度试验机-苏州皖仪实验仪器有限公司 | 北京网站建设-企业网站建设-建站公司-做网站-北京良言多米网络公司 | 优秀的临床医学知识库,临床知识库,医疗知识库,满足电子病历四级要求,免费试用 | Safety light curtain|Belt Sway Switches|Pull Rope Switch|ultrasonic flaw detector-Shandong Zhuoxin Machinery Co., Ltd | 叉车电池-叉车电瓶-叉车蓄电池-铅酸蓄电池-电动叉车蓄电池生产厂家 | 深圳办公室装修-写字楼装修设计-深圳标榜装饰公司 | 浙江清风侠环保设备有限公司| 炒货机-炒菜机-炒酱机-炒米机@霍氏机械 | 全自动过滤器_反冲洗过滤器_自清洗过滤器_量子除垢环_量子环除垢_量子除垢 - 安士睿(北京)过滤设备有限公司 | 热工多功能信号校验仪-热电阻热电偶校验仿真仪-金湖虹润仪表 | 噪声治理公司-噪音治理专业隔音降噪公司 | 洁净实验室工程-成都手术室净化-无尘车间装修-四川华锐净化公司-洁净室专业厂家 | 防伪溯源|防窜货|微信二维码营销|兆信_行业内领先的防伪防窜货数字化营销解决方案供应商 | 杭州标识标牌|文化墙|展厅|导视|户内外广告|发光字|灯箱|铭阳制作公司 - 杭州标识标牌|文化墙|展厅|导视|户内外广告|发光字|灯箱|铭阳制作公司 | COD分析仪|氨氮分析仪|总磷分析仪|总氮分析仪-圣湖Greatlake | 沈阳液压泵_沈阳液压阀_沈阳液压站-沈阳海德太科液压设备有限公司 | 成都亚克力制品,PVC板,双色板雕刻加工,亚克力门牌,亚克力标牌,水晶字雕刻制作-零贰捌广告 | 低压载波电能表-单相导轨式电能表-华邦电力科技股份有限公司-智能物联网综合管理平台 | 七维官网-水性工业漆_轨道交通涂料_钢结构漆 | 沈阳网站建设_沈阳网站制作_沈阳网页设计-做网站就找示剑新零售 沈阳缠绕膜价格_沈阳拉伸膜厂家_沈阳缠绕膜厂家直销 | 长沙一级消防工程公司_智能化弱电_机电安装_亮化工程专业施工承包_湖南公共安全工程有限公司 | 电竞学校_电子竞技培训学校学院-梦竞未来电竞学校官网 | 喷码机,激光喷码打码机,鸡蛋打码机,手持打码机,自动喷码机,一物一码防伪溯源-恒欣瑞达有限公司 | 江苏农村商业银行招聘网_2024江苏农商行考试指南_江苏农商行校园招聘 | 电磁铁_推拉电磁铁_机械手电磁吸盘电磁铁厂家-广州思德隆电子公司 | 西门子伺服电机维修,西门子电源模块维修,西门子驱动模块维修-上海渠利 | Copeland/谷轮压缩机,谷轮半封闭压缩机,谷轮涡旋压缩机,型号规格,技术参数,尺寸图片,价格经销商 CTP磁天平|小电容测量仪|阴阳极极化_双液系沸点测定仪|dsj电渗实验装置-南京桑力电子设备厂 | 浙江筋膜枪-按摩仪厂家-制造商-肩颈按摩仪哪家好-温州市合喜电子科技有限公司 | 阳光模拟试验箱_高低温试验箱_高低温冲击试验箱_快速温变试验箱|东莞市赛思检测设备有限公司 |