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

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

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

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

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

        PDO 調(diào)試 - 綁定后查看查詢?

        PDO Debugging - View Query AFTER Bind?(PDO 調(diào)試 - 綁定后查看查詢?)
      2. <legend id='VtBer'><style id='VtBer'><dir id='VtBer'><q id='VtBer'></q></dir></style></legend>

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

              <tbody id='VtBer'></tbody>

              <tfoot id='VtBer'></tfoot>

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

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

                  本文介紹了PDO 調(diào)試 - 綁定后查看查詢?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  可能的重復(fù):
                  從 PDO 準(zhǔn)備好的語句中檢索(或模擬)完整查詢

                  我不明白為什么我的查詢返回 0 行..它實現(xiàn)了一些非常動態(tài)的搜索功能,以及很多 if/loop 語句等.因此要調(diào)試它,我想看看到底是什么字符串正在發(fā)送到服務(wù)器.有沒有辦法通過 PHP 做到這一點?

                  I can't figure out why my query is returning 0 rows.. it implements some very dynamic search functionality, and a lot of if/loop statements etc. Therefor to debug it, I'd like to see EXACTLY what string is being sent to the server. Is there a way to do this through PHP?

                  有沒有辦法詢問服務(wù)器上次查詢是什么",或者告訴 PDO告訴我你發(fā)送了什么"?

                  Is there maybe a way to ask the server "what was the last query", or tell PDO "show me what you sent"?

                  我看到一個使用 str_replace 手動輸入值代替 :fieldValue 的響應(yīng),但這可能是語法問題(或者它可能正在經(jīng)歷不正確的循環(huán),等),此方法無濟于事.

                  I saw one response using str_replace to manually enter the values in place of :fieldValue, but it's likely a syntax problem (or maybe it's going through an incorrect loop, etc), which this method doesn't help with.

                  使用 bindValue(":fieldValue", $value); 如果這有所不同.

                  Using bindValue(":fieldValue", $value); if that makes a difference.

                  編輯

                  結(jié)果是一個簡單的 if ($var="true") { ... 應(yīng)該是 if ($var=="true") { ....從這個意義上說,我猜 PHP 與 Java 不一樣?無論哪種方式,問題仍然存在(因為我經(jīng)常遇到這種情況).我不得不使用一系列 echo "You are Here"; 來找到這個錯誤,因為它在技術(shù)上有效但不正確.如果我有最后的 SQL 語句,我可以看到哦,我的代碼添加了 where column = true,一定是通過了錯誤的 IF...".

                  Turns out it was a simple if ($var="true") { ... which should have been if ($var=="true") { .... PHP I guess is not the same as Java in that sense? Either way, the question still stands (as I run into this often). I had to use a series of echo "You are Here"; to find this error, as it was technically valid but not correct. If I had the final SQL statement, I could have seen "Oh, my code has added the where column = true, must have gone through the wrong IF...".

                  推薦答案

                  這是關(guān)于 SQL 調(diào)試的一個最常見的誤區(qū).我需要在準(zhǔn)備后查看查詢才能判斷是否發(fā)生了錯誤".事實是,你不,我會告訴你原因.

                  That's the single most common myth about SQL debugging. "I need to see the query after preparation to be able to tell if an error occurred". The fact is, you don't, and I'll tell you why.

                  準(zhǔn)備好查詢后,可以將占位符視為有效字符串/整數(shù).你不在乎里面有什么.

                  Once a query has been prepared, the placeholder can be considered as a valid string/integer. You don't care what's in it.

                  此外,如果您正確設(shè)置了 PDO,您將獲得詳細的 PDOException 詳細說明您遇到的錯誤以及錯誤發(fā)生位置的完整回溯,以及您獲得錯誤字符串來自 MySQL,這使得語法錯誤很容易被發(fā)現(xiàn).

                  Also, if you set up PDO correctly, you'll get a detailed PDOException detailing the error you've had along with a complete backtrace of where the error happened, plus you get the error string from MySQL, which makes syntax errors very easy to find.

                  要啟用 PDO 異常并禁用模擬準(zhǔn)備:

                  To enable PDO Exceptions and disable emulated prepares:

                  $pdo = new PDO("mysql:host=localhost;dbname=database_name", "user", "password");
                  $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
                  $pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
                  

                  這篇關(guān)于PDO 調(diào)試 - 綁定后查看查詢?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(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 可滾動游標(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 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動程序)

                      <tbody id='aFPNk'></tbody>

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

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

                            主站蜘蛛池模板: 欧美日韩免费 | 国产高清视频一区二区 | 国产不卡视频在线 | 韩日av片| 国产精品视频999 | 欧美精品一区在线 | 日本一区二区电影 | 国产成人在线播放 | 久久久久久国产 | 欧美精品一二三区 | 碰碰视频 | www.国产91| 91精品国产乱码久久久久久久 | 日韩综合在线播放 | 一区二区三区四区在线 | 日韩欧美网| 免费观看一级毛片 | 国产精品久久久久久中文字 | 免费视频一区二区三区在线观看 | 精品久久一 | 欧美精选一区二区 | 中文字幕精品一区二区三区精品 | 国产在线一区二区三区 | 狠狠久久综合 | 蜜月va乱码一区二区三区 | 日韩在线精品强乱中文字幕 | 精品视频在线一区 | 99久久精品一区二区成人 | 搞av.com| 久久一二 | 日韩中文字幕一区二区三区 | 91视频大全 | 亚洲精品乱码久久久久久蜜桃91 | 一区二区三区在线免费观看 | 国产精品美女久久久久久久久久久 | 亚洲精品福利在线 | 男女午夜免费视频 | 日本理论片好看理论片 | 久草视频在 | 日韩欧美精品 | 成人免费视频网址 |