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

<legend id='stUxy'><style id='stUxy'><dir id='stUxy'><q id='stUxy'></q></dir></style></legend>
    • <bdo id='stUxy'></bdo><ul id='stUxy'></ul>

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

      <tfoot id='stUxy'></tfoot>

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

      獲取帶有綁定參數(shù)的 PDO 查詢字符串而不執(zhí)行它

      Getting a PDO query string with bound parameters without executing it(獲取帶有綁定參數(shù)的 PDO 查詢字符串而不執(zhí)行它)
      <tfoot id='ojKbd'></tfoot>

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

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

                  <tbody id='ojKbd'></tbody>
              1. <small id='ojKbd'></small><noframes id='ojKbd'>

                本文介紹了獲取帶有綁定參數(shù)的 PDO 查詢字符串而不執(zhí)行它的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                是否可以在不先執(zhí)行的情況下從帶有綁定參數(shù)的 PDO 對(duì)象中獲取查詢字符串?我有類似于以下的代碼(其中 $dbc 是 PDO 對(duì)象):

                Is it possible to get a query string from a PDO object with bound parameters without executing it first? I have code similar to the following (where $dbc is the PDO object):

                $query = 'SELECT * FROM users WHERE username = ?';
                $result = $dbc->prepare($query);
                $username = 'bob';
                $result->bindParam(1, $username);
                echo $result->queryString;
                

                目前,這將輸出一條 SQL 語句,例如:SELECT * FROM users WHERE username = ?".但是,我希望包含綁定參數(shù),使其看起來像:'SELECT * FROM users WHERE username = 'bob'".有沒有辦法在不執(zhí)行它或通過某些東西用參數(shù)替換問號(hào)的情況下做到這一點(diǎn)像 preg_replace?

                Currently, this will echo out a SQL statement like: "SELECT * FROM users WHERE username = ?". However, I would like to have the bound parameter included so that it looks like: 'SELECT * FROM users WHERE username = 'bob'". Is there a way to do that without executing it or replacing the question marks with the parameters through something like preg_replace?

                推薦答案

                簡而言之:沒有.請(qǐng)參閱從 PDO 準(zhǔn)備好的語句中獲取原始 SQL 查詢字符串

                In short: no. See Getting raw SQL query string from PDO prepared statements

                如果您只想模擬它,請(qǐng)嘗試:

                If you want to just emulate it, try:

                echo preg_replace('?', $username, $result->queryString);
                

                這篇關(guān)于獲取帶有綁定參數(shù)的 PDO 查詢字符串而不執(zhí)行它的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                相關(guān)文檔推薦

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

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

                          <tbody id='AYHKB'></tbody>
                        <i id='AYHKB'><tr id='AYHKB'><dt id='AYHKB'><q id='AYHKB'><span id='AYHKB'><b id='AYHKB'><form id='AYHKB'><ins id='AYHKB'></ins><ul id='AYHKB'></ul><sub id='AYHKB'></sub></form><legend id='AYHKB'></legend><bdo id='AYHKB'><pre id='AYHKB'><center id='AYHKB'></center></pre></bdo></b><th id='AYHKB'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='AYHKB'><tfoot id='AYHKB'></tfoot><dl id='AYHKB'><fieldset id='AYHKB'></fieldset></dl></div>
                          <bdo id='AYHKB'></bdo><ul id='AYHKB'></ul>
                          <tfoot id='AYHKB'></tfoot>
                          主站蜘蛛池模板: 精品亚洲一区二区 | av大片 | 亚洲免费精品 | 黄色一级毛片 | 99pao成人国产永久免费视频 | 国产一级淫片免费视频 | 国产在线观看 | 中文字幕在线看人 | 久久影音先锋 | 中文字幕一区二区三区四区 | 亚洲精品亚洲人成人网 | 欧美综合视频在线 | 日韩av资源站 | 久久福利| 国产小视频在线看 | 国产综合久久 | 欧美久久国产 | 婷婷色国产偷v国产偷v小说 | 草草草久久久 | 日韩国产中文字幕 | 91porn在线观看 | 午夜视频一区二区三区 | 欧美日韩电影一区二区 | 成人av看片| 日本手机看片 | 午夜在线电影网 | 在线视频 欧美日韩 | 正在播放一区二区 | 精品国产视频 | 国产区精品| 射久久 | 国产欧美一区二区三区日本久久久 | 欧美日韩综合精品 | 亚洲一区二区三区在线视频 | 精品视频免费 | 国产精品久久99 | 日本一区视频在线观看 | 久久久久久黄 | 精品视频在线播放 | 成人免费视频网站在线看 | 久久久久国产 |