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

  1. <legend id='lVfvJ'><style id='lVfvJ'><dir id='lVfvJ'><q id='lVfvJ'></q></dir></style></legend>

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

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

  2. <tfoot id='lVfvJ'></tfoot>
      <bdo id='lVfvJ'></bdo><ul id='lVfvJ'></ul>

    1. php 5.2.6 的 mysqli_stmt_get_result 替代方案

      mysqli_stmt_get_result alternative for php 5.2.6(php 5.2.6 的 mysqli_stmt_get_result 替代方案)
          <tbody id='Gn2xb'></tbody>
        <tfoot id='Gn2xb'></tfoot>
          • <i id='Gn2xb'><tr id='Gn2xb'><dt id='Gn2xb'><q id='Gn2xb'><span id='Gn2xb'><b id='Gn2xb'><form id='Gn2xb'><ins id='Gn2xb'></ins><ul id='Gn2xb'></ul><sub id='Gn2xb'></sub></form><legend id='Gn2xb'></legend><bdo id='Gn2xb'><pre id='Gn2xb'><center id='Gn2xb'></center></pre></bdo></b><th id='Gn2xb'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Gn2xb'><tfoot id='Gn2xb'></tfoot><dl id='Gn2xb'><fieldset id='Gn2xb'></fieldset></dl></div>
            <legend id='Gn2xb'><style id='Gn2xb'><dir id='Gn2xb'><q id='Gn2xb'></q></dir></style></legend>

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

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

                本文介紹了php 5.2.6 的 mysqli_stmt_get_result 替代方案的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問(wèn)題描述

                我不是php專(zhuān)家,我開(kāi)發(fā)了一個(gè)查詢(xún)mysql數(shù)據(jù)庫(kù)的小服務(wù).

                I am not an expert of php, I developed a small service which query a mysql db.

                但是我用 php 5.4 開(kāi)發(fā),然后發(fā)現(xiàn)我的虛擬主機(jī)計(jì)劃有 5.2.6,所以我對(duì)一些未定義的函數(shù)幾乎沒(méi)有問(wèn)題.

                However I developed with php 5.4, and then discovered that my web hosting plan has 5.2.6, so I am having few problems with some undefined function.

                具體來(lái)說(shuō),在這種情況下,如何解決 > 5.3 上可用的 mysqli_stmt_get_result 未定義函數(shù)?代碼如下:

                Specifically, in this case, how can I solve the mysqli_stmt_get_result undefined function available on > 5.3 ? Here is the code:

                  $stmt = mysqli_prepare($con,$db_query);
                
                  if($stmt) {
                
                     mysqli_stmt_bind_param($stmt,'ss',$after,$lang);
                     mysqli_stmt_execute($stmt);
                     $result = mysqli_stmt_get_result($stmt); // <-- getting undefined error here !!!
                
                     $updated = array();
                     $deleted = array();
                
                     while($row = mysqli_fetch_assoc($result)) {
                
                        if($row['status']==1) {
                           array_push($updated,$row);
                        } else {
                           $cardName=$row['cardName'];
                           $cardStatus=$row['status'];
                           $cardId=$row['cardId'];
                           $language=$row['language'];
                           array_push($deleted,array(
                                    'cardName'=>$cardName,
                                                    'status'=>$cardStatus,
                                                    'cardId'=>$cardId,
                                                    'language'=>$language
                                               )
                           );
                        }
                     }
                
                     $response = array(
                        'cards'=>array(
                           'updated'=>$updated,
                           'deleted'=>$deleted
                        )
                     );
                
                     $json = json_encode($response);
                     mysqli_close($con);
                     echo $json;
                
                  }
                

                關(guān)鍵是我使用的是準(zhǔn)備好的語(yǔ)句,由于我缺乏 php 知識(shí),我發(fā)現(xiàn)沒(méi)有其他方法可以在不重寫(xiě)整個(gè)腳本的情況下解決問(wèn)題.

                The point is that I am using a prepared statement, due to my lack of php knowledge I found no other way of resolving the issue without rewriting the whole script.

                我認(rèn)為你們中的一些人可能有一個(gè)簡(jiǎn)單易行的解決方案.

                I thought that some of you may have a simple and easy solution.

                推薦答案

                mysqli_stmt_get_result 函數(shù)僅適用于 PHP 5.3 或更高版本.您的 PHP 5.2.x 版本不存在它(順便說(shuō)一句,不再支持該版本).

                The mysqli_stmt_get_result function is PHP 5.3 or greater only. It does not exist for your PHP 5.2.x version (which is not supported any longer btw.).

                另一種方法是使用帶有變量綁定的 mysqli_stmt_bind_result.

                The alternative is to use mysqli_stmt_bind_result with variable bindings.

                在您的具體示例中,這甚至具有您不需要將數(shù)組成員分配給變量的好處,因?yàn)槟梢灾苯咏壎ㄗ兞?

                In your concrete example this has even the benefit that you do not need to assign the array members to variables, because you can bind the variables directly.

                引入mysqli_stmt_get_result 函數(shù)是因?yàn)橛腥苏J(rèn)為 這會(huì)妨礙您并且獲取數(shù)組會(huì)更容易.

                The mysqli_stmt_get_result function was introduced because someone thought this would stand in your way and getting an array would have been easier.

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

                【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(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 準(zhǔn)備好的語(yǔ)句問(wèn)題)
                mysqli_fetch_array returning only one result(mysqli_fetch_array 只返回一個(gè)結(jié)果)
                PHP MySQLi Multiple Inserts(PHP MySQLi 多次插入)
                How do I make sure that values from MySQL keep their type in PHP?(如何確保 MySQL 中的值在 PHP 中保持其類(lèi)型?)

                  <bdo id='0dQpm'></bdo><ul id='0dQpm'></ul>

                • <legend id='0dQpm'><style id='0dQpm'><dir id='0dQpm'><q id='0dQpm'></q></dir></style></legend>

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

                    <small id='0dQpm'></small><noframes id='0dQpm'>

                          主站蜘蛛池模板: 国产一区日韩在线 | 成人h视频在线 | www.久久久.com | 中文字幕乱码一区二区三区 | 狠狠操狠狠操 | 成人av免费 | 亚洲免费精品一区 | 午夜网| 久久久久久成人 | 蜜桃精品视频在线 | 九九色综合 | 日韩高清一区 | 天天拍夜夜爽 | 97超碰在线播放 | 国产一区二区三区免费 | 久久专区 | 欧美一级片在线 | 亚洲最新在线视频 | 亚洲综合在线视频 | 天天草夜夜骑 | 亚洲国产精品一区 | 日韩影音 | 成人在线观 | 亚洲精品高清视频在线观看 | 日日操视频 | 91精品观看 | 成人午夜激情 | 亚洲欧美国产毛片在线 | 又爽又黄axxx片免费观看 | 国产成人免费视频网站视频社区 | 天天色综 | 国产精品视频一二三区 | 成人免费在线 | 色婷婷精品国产一区二区三区 | 国产中文字幕在线观看 | 999国产精品视频 | 激情一区二区三区 | 日韩伦理电影免费在线观看 | 91精品中文字幕一区二区三区 | 亚洲天天干 | 午夜电影网 |