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

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

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

        <tfoot id='r32ek'></tfoot>

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

        <legend id='r32ek'><style id='r32ek'><dir id='r32ek'><q id='r32ek'></q></dir></style></legend>

        PHP: mysql v mysqli v pdo

        PHP: mysql v mysqli v pdo(PHP: mysql v mysqli v pdo)
          <legend id='wq8n4'><style id='wq8n4'><dir id='wq8n4'><q id='wq8n4'></q></dir></style></legend>
          <i id='wq8n4'><tr id='wq8n4'><dt id='wq8n4'><q id='wq8n4'><span id='wq8n4'><b id='wq8n4'><form id='wq8n4'><ins id='wq8n4'></ins><ul id='wq8n4'></ul><sub id='wq8n4'></sub></form><legend id='wq8n4'></legend><bdo id='wq8n4'><pre id='wq8n4'><center id='wq8n4'></center></pre></bdo></b><th id='wq8n4'></th></span></q></dt></tr></i><div class="0votry5" id='wq8n4'><tfoot id='wq8n4'></tfoot><dl id='wq8n4'><fieldset id='wq8n4'></fieldset></dl></div>
          1. <tfoot id='wq8n4'></tfoot>

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

                    <tbody id='wq8n4'></tbody>
                • <small id='wq8n4'></small><noframes id='wq8n4'>

                • 本文介紹了PHP: mysql v mysqli v pdo的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我一直在閱讀一些關于使用 mysqli 與 pdo 在 php 中使用 mysql 的問題.

                  I've been reading some questions regarding using mysqli versus pdo to use mysql in php.

                  我見過諸如 mysqli 或 PDO 之類的問題 -優點和缺點是什么? 或 從mysql 到 mysqli 或 pdo?,它們都專門處理 mysqli v pdo.我對這兩種方法哪個更好不感興趣.

                  I've seen questions such as mysqli or PDO - what are the pros and cons? or Moving from mysql to mysqli or pdo?, which both deal with mysqli v pdo exclusively. I'm not as much interested as to which of these two methods are better.

                  我想知道為什么應該避免使用 mysql_ 函數.當然,根據 PHP 的文檔,它們正在被棄用 http://php.net/manual/en/faq.databases.php#faq.databases.mysql.deprecated,線程 PHP PDO 和 MySQLi 表明 PDO 和 MySQLi 更強大,并且線程 MySQL、MySQLi 和 PDO 有什么區別? 暗示這些較新的方法更安全.

                  I was wondering why mysql_ functions should be avoided. Of course, they're in the process of being deprecated per PHP's documentation http://php.net/manual/en/faq.databases.php#faq.databases.mysql.deprecated, the thread PHP PDO and MySQLi suggests PDO and MySQLi are more poweful, and the thread What is the difference between MySQL, MySQLi and PDO? implies that these newer methods are more secure.

                  總的來說,我想知道 mysql_ 方法的主要弱點是什么,以及避免它的原因是什么(我想更具體地說,不僅僅是因為它已被棄用).我正計劃更新受影響的腳本,并且很好奇為什么不推薦使用這種舊方法.

                  Overall, I'm wondering what are the big weaknesses in the mysql_ methods, and what reasons there are for avoiding it (I guess more specifically than just because it's deprecated). I'm planning to update my affected scripts, and became curious as to why this old method was deprecated.

                  謝謝!

                  推薦答案

                  mysql_query 函數的設計使得你必須小心地轉義你的每一位數據'重新注入它,如果你錯過了一個,你的整個應用程序都可能被自動 SQL 漏洞利用工具破壞.

                  The design of the mysql_query function is such that you've got to be careful to escape each and every bit of data you're injecting into it, and if you miss even one your entire application can be destroyed by an automatic SQL vulnerability exploit tool.

                  mysqli 和 PDO 都支持占位符,必須確保您的查詢不受 SQL 注入錯誤的影響.對所有內容調用 mysql_real_escape_string 不僅乏味,而且容易出錯,這就是問題出現的地方.

                  Both mysqli and PDO support placeholders which are required to ensure that your queries are safe from SQL injection bugs. Calling mysql_real_escape_string on everything is not only tedious, but error-prone, and that's where the problems arise.

                  mysql 函數是 PHP 早期的產物,與 mysqli 作為選項提供的面向對象的新特性相比,它明顯受到更多限制,或 PDO 設計.

                  The mysql functions are a product of the very early days of PHP and are significantly more limited than the new object-oriented features offered by both mysqli as an option, or PDO by design.

                  使用這兩個新接口之一有很多很好的理由,但最重要的是 mysql_query 函數在生產代碼中使用太危險了.有了它,您將永遠遠離一些非常嚴重的問題.

                  There's a number of very good reasons to use one of these two new interfaces, but the most important is that the mysql_query function is simply too hazardous to use in production code. With it you will always be one mistake away from some very serious problems.

                  充滿密碼和信用卡號的數據庫不斷出現是有原因的.擁有一個明顯的 SQL 注入點使得完全接管一個站點幾乎太容易了.

                  There's a reason rips of databases full of passwords and credit card numbers keep showing up. Having an obvious SQL injection point makes it almost too easy to completely take over a site.

                  這篇關于PHP: mysql v mysqli v pdo的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

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

                    <bdo id='Psru3'></bdo><ul id='Psru3'></ul>
                      <tbody id='Psru3'></tbody>

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

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

                          1. <tfoot id='Psru3'></tfoot>

                          2. <i id='Psru3'><tr id='Psru3'><dt id='Psru3'><q id='Psru3'><span id='Psru3'><b id='Psru3'><form id='Psru3'><ins id='Psru3'></ins><ul id='Psru3'></ul><sub id='Psru3'></sub></form><legend id='Psru3'></legend><bdo id='Psru3'><pre id='Psru3'><center id='Psru3'></center></pre></bdo></b><th id='Psru3'></th></span></q></dt></tr></i><div class="ahu0rgk" id='Psru3'><tfoot id='Psru3'></tfoot><dl id='Psru3'><fieldset id='Psru3'></fieldset></dl></div>
                            主站蜘蛛池模板: 四探针电阻率测试仪-振实密度仪-粉末流动性测定仪-宁波瑞柯微智能 | 铝合金重力铸造_铝合金翻砂铸造_铝铸件厂家-东莞市铝得旺五金制品有限公司 | 离子色谱自动进样器-青岛艾力析实验科技有限公司 | ph计,实验室ph计,台式ph计,实验室酸度计,台式酸度计 | 氟氨基酮、氯硝柳胺、2-氟苯甲酸、异香兰素-新晨化工 | 快干水泥|桥梁伸缩缝止水胶|伸缩缝装置生产厂家-广东广航交通科技有限公司 | 网站seo优化_seo云优化_搜索引擎seo_启新网络服务中心 | 代理记账_免费注册公司_营业执照代办_资质代办-【乐财汇】 | 专业广州网站建设,微信小程序开发,一物一码和NFC应用开发、物联网、外贸商城、定制系统和APP开发【致茂网络】 | 博莱特空压机|博莱特-阿特拉斯独资空压机品牌核心代理商 | 甲级防雷检测仪-乙级防雷检测仪厂家-上海胜绪电气有限公司 | 贝朗斯动力商城(BRCPOWER.COM) - 买叉车蓄电池上贝朗斯商城,价格更超值,品质有保障! | 盘扣式脚手架-附着式升降脚手架-移动脚手架,专ye承包服务商 - 苏州安踏脚手架工程有限公司 | 球盟会·(中国)官方网站| 电缆接头_防水接头_电缆防水接头 - 乐清市新豪电气有限公司 | 客服外包专业服务商_客服外包中心_网萌科技 | 新型游乐设备,360大摆锤游乐设备「诚信厂家」-山东方鑫游乐设备 新能源汽车电池软连接,铜铝复合膜柔性连接,电力母排-容发智能科技(无锡)有限公司 | 杭州顺源过滤机械有限公司官网-压滤机_板框压滤机_厢式隔膜压滤机厂家 | 空气能采暖,热泵烘干机,空气源热水机组|设备|厂家,东莞高温热泵_正旭新能源 | 执业药师报名条件,考试时间,考试真题,报名入口—首页 | 福州甲醛检测-福建室内空气检测_环境检测_水质检测-福建中凯检测技术有限公司 | 无锡网站建设_小程序制作_网站设计公司_无锡网络公司_网站制作 | 上海小程序开发-上海小程序制作公司-上海网站建设-公众号开发运营-软件外包公司-咏熠科技 | 北京网站建设|北京网站开发|北京网站设计|高端做网站公司 | 商用绞肉机-熟肉切片机-冻肉切丁机-猪肉开条机 - 广州市正盈机械设备有限公司 | 哔咔漫画网页版在线_下载入口访问指引| 实体店商新零售|微赢|波后|波后合作|微赢集团 | 执业药师报名时间,报考条件,考试时间-首页入口 | 胜为光纤光缆_光纤跳线_单模尾纤_光纤收发器_ODF光纤配线架厂家直销_北京睿创胜为科技有限公司 - 北京睿创胜为科技有限公司 | 【铜排折弯机,钢丝折弯成型机,汽车发泡钢丝折弯机,线材折弯机厂家,线材成型机,铁线折弯机】贝朗折弯机厂家_东莞市贝朗自动化设备有限公司 | 动力配电箱-不锈钢配电箱-高压开关柜-重庆宇轩机电设备有限公司 聚天冬氨酸,亚氨基二琥珀酸四钠,PASP,IDS - 远联化工 | 成都中天自动化控制技术有限公司 | 冷却塔减速机器_冷却塔皮带箱维修厂家_凉水塔风机电机更换-广东康明冷却塔厂家 | 膜片万向弹性联轴器-冲压铸造模具「沧州昌运模具」 | 广州冷却塔维修厂家_冷却塔修理_凉水塔风机电机填料抢修-广东康明节能空调有限公司 | 常州企业采购平台_常州MRO采购公司_常州米孚机电设备有限公司 | 专业的新乡振动筛厂家-振动筛品质保障-环保振动筛价格—新乡市德科筛分机械有限公司 | app开发|app开发公司|小程序开发|物联网开发||北京网站制作|--前潮网络 | 台湾阳明固态继电器-奥托尼克斯光电传感器-接近开关-温控器-光纤传感器-编码器一级代理商江苏用之宜电气 | 山东商品混凝土搅拌楼-环保型搅拌站-拌合站-分体仓-搅拌机厂家-天宇 | 烟气在线监测系统_烟气在线监测仪_扬尘检测仪_空气质量监测站「山东风途物联网」 |