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

    <bdo id='QAPzj'></bdo><ul id='QAPzj'></ul>
    <legend id='QAPzj'><style id='QAPzj'><dir id='QAPzj'><q id='QAPzj'></q></dir></style></legend>
  • <small id='QAPzj'></small><noframes id='QAPzj'>

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

        PDO 與 MYSQLI,準備好的語句和綁定參數

        PDO vs MYSQLI, Prepared Statemens and Binding Parameters(PDO 與 MYSQLI,準備好的語句和綁定參數)

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

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

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

                  <legend id='AkACH'><style id='AkACH'><dir id='AkACH'><q id='AkACH'></q></dir></style></legend>
                    <tbody id='AkACH'></tbody>
                  本文介紹了PDO 與 MYSQLI,準備好的語句和綁定參數的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有這個問題需要澄清.我閱讀了一些文檔和評論,但仍有一些不夠清楚.

                  I have this very question to clear things up. I read some documentation and comments around but still somethings are just not clear enough.

                  • 我知道 PDO 提供了更多驅動程序,如果您更改數據庫類型,這當然是一個加分項.
                  • 正如在另一篇文章中所說,PDO 不提供真正的預處理語句,但 mysqli 提供,因此使用 MYSQLI 會更安全
                  • 基準看起來很相似,(沒有自己測試,而是在網上檢查了一些基準)
                  • 面向對象對我來說不是問題,因為 mysqli 正在迎頭趕上.但是對程序 mysqli 與 PDO 進行基準測試會很好,因為程序應該稍微快一點.

                  但這是我的問題,對于準備好的語句,我們是否必須對我們在語句中使用的數據使用參數綁定?好的做法還是必須的?我知道如果您多次運行相同的查詢,準備好的語句在性能方面是很好的,但這足以保護查詢本身嗎?或綁定參數是必須的?綁定參數究竟是什么以及它如何保護數據免受 sql 注入?如果您指出我們對我上述陳述的任何誤解,我們也將不勝感激.

                  But here is my question, with prepared statement, do we have to use parameter binding with the data we use in our statement? good practice or have to? I understand prepared statements are good perfermance-wise if you run the same query multiple times but it is enough to secure the query itself? or binding parameters is a must? What exactly do the binding parameters and how it works to protect the data from sql injection? Also would be appreciated if you point our any misunderstanding about the statements I made above.

                  推薦答案

                  簡而言之,

                  • 綁定是必須的,它是保護的基石,無論原生驅動是否支持.重要的是替代的想法.
                  • 差異在安全性和性能方面可以忽略不計.
                  • 性能是最后要考慮的事情.沒有比其他 API 慢得多的 API.它不是可能導致任何性能問題的類或函數,而是數據操作或糟糕的算法.優化您的查詢,而不僅僅是調用它們的函數.
                  • 如果您打算使用原始的裸 API,那么 PDO 是唯一的選擇.雖然包含在更高級別的類中,但 mysqli 似乎更適合 mysql.
                  • mysqli 和 PDO 都缺少標識符和關鍵字的綁定.在這種情況下,必須實施基于白名單的保護.這是我的文章,帶有現成的示例,將字段名稱動態添加到 SQL 查詢
                  • Binding is a must, being a cornerstone of protection, no matter if it is supported by a native driver or not. It's the idea of substitution that matters.
                  • The difference is negligible in either safety and performance.
                  • Performance is the last thing to consider. There is NO API that is considerable slower than other. It is not a class or a function that may cause whatever performance problem but a data manipulation or a bad algorithm. Optimize your queries, not mere functions to call them.
                  • If you are going to use a raw bare API, then PDO is the only choice. While wrapped in a higher level class, mysqli seems more preferable for mysql.
                  • Both mysqli and PDO lack bindings for the identifiers and keywords. In this case a whitelist-based protection must be implemented. Here is my article with the ready made example, Adding a field name to the SQL query dynamically

                  這篇關于PDO 與 MYSQLI,準備好的語句和綁定參數的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 找不到驅動程序)
                    <tbody id='Lc1dg'></tbody>
                    <tfoot id='Lc1dg'></tfoot>
                      <legend id='Lc1dg'><style id='Lc1dg'><dir id='Lc1dg'><q id='Lc1dg'></q></dir></style></legend>
                        <bdo id='Lc1dg'></bdo><ul id='Lc1dg'></ul>
                        1. <small id='Lc1dg'></small><noframes id='Lc1dg'>

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

                            主站蜘蛛池模板: 亚洲在线观看视频 | 久草视| 97久久精品午夜一区二区 | 久久精品国产亚洲 | 欧美激情综合 | 亚洲不卡在线观看 | 国产精品国产精品 | 国产精品99久久久精品免费观看 | 亚洲视频网 | 性xxxxx | 午夜寂寞影院列表 | 精品毛片 | 久久精品一级 | 国产不卡视频在线 | 黄色毛片在线看 | 国产精品99久久久久久宅男 | 精品久久久久久久久久 | 午夜精品一区二区三区在线播放 | 成人黄色在线 | 91影院 | 天天碰日日操 | 一本岛道一二三不卡区 | 成人午夜精品 | 久久国产精品一区二区 | 久久这里只有 | 国产精品欧美一区二区三区 | 黄片毛片在线观看 | 日韩国产中文字幕 | 一区二区三区高清 | 久久精品青青大伊人av | 亚州精品天堂中文字幕 | 国产精品一区二区免费 | 成人在线观看中文字幕 | 毛片一级网站 | 亚洲国产伊人 | 又黑又粗又长的欧美一区 | 亚洲成人免费 | 国产在线拍偷自揄拍视频 | 久色网 | 亚洲成人免费 | 综合久久综合久久 |