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

    <legend id='Zc1pd'><style id='Zc1pd'><dir id='Zc1pd'><q id='Zc1pd'></q></dir></style></legend><tfoot id='Zc1pd'></tfoot>

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

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

        PHP PDO::bindParam() 數據類型..它是如何工作的?

        PHP PDO::bindParam() data types.. how does it work?(PHP PDO::bindParam() 數據類型..它是如何工作的?)
          <tbody id='lbLZQ'></tbody>
          <legend id='lbLZQ'><style id='lbLZQ'><dir id='lbLZQ'><q id='lbLZQ'></q></dir></style></legend>

        • <tfoot id='lbLZQ'></tfoot>

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

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

                  本文介紹了PHP PDO::bindParam() 數據類型..它是如何工作的?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我想知道 bindParam() 中數據類型的聲明是什么(或bindValue()) 用于...

                  I'm wondering what the declaration of the data type in bindParam() (or bindValue()) is used for...

                  我的意思是,我認為如果我定義一個整數參數 (PDO::PARAM_INT),該參數必須轉換為一個整數,例如

                  I mean, I thought that if I define an integer argument (PDO::PARAM_INT), the argument must be converted to an integer, something like

                  $delete->bindParam(1, $kill, PDO::PARAM_INT);
                  // should work like
                  $delete->bindParam(1, (int)$kill);
                  

                  或者至少在參數不是聲明的類型時拋出錯誤.但事實并非如此.

                  or at least throw an error if the argument is not of the declared type. But this is not the case.

                  谷歌搜索,我發現在 php.net 檔案中:

                  Googling around, I found that in the php.net archive:

                  大家好,

                  我目前正在研究 PDO.確切地在 bindParam() 函數上.第三參數 data_type 似乎在這里強制值的類型?但當我嘗試時:

                  I am currently working on PDO. Exactly on the bindParam() function. The third parameter data_type seems to be here to force the type of the value ? But when I try :

                  $sql = "INSERT INTO produit (idproduit, nom, marque) VALUES (NULL, :nom, :marque)";
                  $stmt = $dbh->prepare($sql);
                  $nom = 'Testarossa'; $marque = 'Ferrari' ;
                  $stmt->BindValue(':marque',$marque) ;
                  $stmt->BindParam(':nom',$nom,PDO::PARAM_INT) ;
                  
                  $stmt->execute(); $nom = '250 GTO' ;
                  $stmt->execute(); ?>
                  

                  我希望有一個 PHP我的數據庫中的錯誤或整數.但在我的數據庫中,我有:

                  I was expecting to have either a PHP error or an interger in my database. But in my DB I have :

                  22 Testarossa 法拉利 23 250 GTO法拉利

                  22 Testarossa Ferrari 23 250 GTO Ferrari

                  這意味著如果我沒有改變有沒有第三個參數.或者也許我錯過了什么.有人可以嗎對我多一點?或者只是有人可以告訴我在哪里可以找到信息關于它.

                  It mean that it didn't change if I have the third parameter or not. Or perhaps I miss something. Can someone tole me more ? Or just can someone told me where I can find information about it.

                  問候,

                  賽勒斯

                  這正是我的情況.我的想法哪里出了問題?

                  That is exactly my situation. Where are my thoughts going wrong?

                  推薦答案

                  在其他語言的其他數據庫抽象框架中,它可用于確保您對內聯值進行正確的轉義(對于驅動程序不支持正確的綁定參數)并通過確保數字被適當地二進制打包來提高網絡效率(給定協議支持).它看起來像在 PDO 中,它沒有做太多事情.

                  In other DB abstraction frameworks in other languages it can be used for things like making sure you're doing the proper escaping for in-lining values (for drivers that don't support proper bound parameters) and improving network efficiency by making sure numbers are binary packed appropriately (given protocol support). It looks like in PDO, it doesn't do much.

                     if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_STR && param->max_value_len <= 0 && ! ZVAL_IS_NULL(param->parameter)) {
                                  if (Z_TYPE_P(param->parameter) == IS_DOUBLE) {
                                          char *p;
                                          int len = spprintf(&p, 0, "%F", Z_DVAL_P(param->parameter));
                                          ZVAL_STRINGL(param->parameter, p, len, 0);
                                  } else {
                                          convert_to_string(param->parameter);
                                  }
                          } else if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_INT && Z_TYPE_P(param->parameter) == IS_BOOL) {
                                  convert_to_long(param->parameter);
                          } else if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_BOOL && Z_TYPE_P(param->parameter) == IS_LONG) {
                                  convert_to_boolean(param->parameter);
                          }
                  

                  所以,如果你說它是一個 STR(或者你什么都不說,因為這是默認的)并且你的數據的內部類型是一個 double 那么它會使用一種方法將它變成一個字符串,如果它不是一個double 然后它將使用不同的方法將其轉換為字符串.

                  So, if you say it is a STR (or if you say nothing at all as that is the default) and your data's internal type is a double then it will turn it into a string using one method, if it's not a double then it will convert it to a string using a different method.

                  如果你說它是一個 int 但它實際上是一個 bool 那么它會將它轉換為 long.

                  If you say it's an int but it is really a bool then it will convert it to a long.

                  如果你說它是一個布爾值,但它實際上是一個數字,那么它會將其轉換為真正的布爾值.

                  If you say it's a bool but it's really a number then it will convert it to a true boolean.

                  這就是我看到的(快速)查看 stmt 源代碼的全部內容,我想一旦您將參數傳遞給驅動程序,它們就可以發揮額外的作用.所以,我猜你得到的只是一點點做對,以及司機之間的大量行為模糊和差異.

                  This is really all I saw (quickly) looking at the stmt source, I imagine once you pass the parameters into the driver they can do additional magic. So, I'd guess that all you get is a little bit of do the right and a whole lot of behavior ambiguity and variance between drivers.

                  這篇關于PHP PDO::bindParam() 數據類型..它是如何工作的?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 找不到驅動程序)
                1. <i id='PfnjU'><tr id='PfnjU'><dt id='PfnjU'><q id='PfnjU'><span id='PfnjU'><b id='PfnjU'><form id='PfnjU'><ins id='PfnjU'></ins><ul id='PfnjU'></ul><sub id='PfnjU'></sub></form><legend id='PfnjU'></legend><bdo id='PfnjU'><pre id='PfnjU'><center id='PfnjU'></center></pre></bdo></b><th id='PfnjU'></th></span></q></dt></tr></i><div class="rcboj2n" id='PfnjU'><tfoot id='PfnjU'></tfoot><dl id='PfnjU'><fieldset id='PfnjU'></fieldset></dl></div>
                  • <bdo id='PfnjU'></bdo><ul id='PfnjU'></ul>

                  • <legend id='PfnjU'><style id='PfnjU'><dir id='PfnjU'><q id='PfnjU'></q></dir></style></legend>
                        <tbody id='PfnjU'></tbody>
                      <tfoot id='PfnjU'></tfoot>

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

                            主站蜘蛛池模板: 烽火安全网_加密软件、神盾软件官网 | 包装盒厂家_纸盒印刷_礼品盒定制-济南恒印包装有限公司 | 吊篮式|移动式冷热冲击试验箱-二槽冷热冲击试验箱-广东科宝 | 航拍_专业的无人机航拍摄影门户社区网站_航拍网 | CNC机加工-数控加工-精密零件加工-ISO认证厂家-鑫创盟 | 洛阳永磁工业大吊扇研发生产-工厂通风降温解决方案提供商-中实洛阳环境科技有限公司 | 外观设计_设备外观设计_外观设计公司_产品外观设计_机械设备外观设计_东莞工业设计公司-意品深蓝 | 全自动烧卖机厂家_饺子机_烧麦机价格_小笼汤包机_宁波江北阜欣食品机械有限公司 | 拉力机-拉力试验机-万能试验机-电子拉力机-拉伸试验机-剥离强度试验机-苏州皖仪实验仪器有限公司 | 高效复合碳源-多核碳源生产厂家-污水处理反硝化菌种一长隆科技库巴鲁 | ISO9001认证咨询_iso9001企业认证代理机构_14001|18001|16949|50430认证-艾世欧认证网 | 哈希余氯测定仪,分光光度计,ph在线监测仪,浊度测定仪,试剂-上海京灿精密机械有限公司 | 塑料检查井_双扣聚氯乙烯增强管_双壁波纹管-河南中盈塑料制品有限公司 | 山东钢格板|栅格板生产厂家供应商-日照森亿钢格板有限公司 | PSI渗透压仪,TPS酸度计,美国CHAI PCR仪,渗透压仪厂家_价格,微生物快速检测仪-华泰和合(北京)商贸有限公司 | 大米加工设备|大米加工机械|碾米成套设备|大米加工成套设备-河南成立粮油机械有限公司 | 深圳货架厂家_金丽声精品货架_广东金丽声展示设备有限公司官网 | 上海道勤塑化有限公司| 实验室装修_实验室设计_实验室规划设计- 上海广建净化工程公司 | 彭世修脚_修脚加盟_彭世修脚加盟_彭世足疗加盟_足疗加盟连锁_彭世修脚技术培训_彭世足疗 | 二手色谱仪器,十万分之一分析天平,蒸发光检测器,电位滴定仪-湖北捷岛科学仪器有限公司 | 软膜天花_软膜灯箱_首选乐创品牌_一站式天花软膜材料供应商! | 深圳办公室装修,办公楼/写字楼装修设计,一级资质 - ADD写艺 | 防火卷帘门价格-聊城一维工贸特级防火卷帘门厂家▲ | 光谱仪_积分球_分布光度计_灯具检测生产厂家_杭州松朗光电【官网】 | WF2户外三防照明配电箱-BXD8050防爆防腐配电箱-浙江沃川防爆电气有限公司 | 便民信息网_家电维修,家电清洗,开锁换锁,本地家政公司 | 书法培训-高考书法艺考培训班-山东艺霖书法培训凭实力挺进央美 | 干式变压器厂_干式变压器厂家_scb11/scb13/scb10/scb14/scb18干式变压器生产厂家-山东科锐变压器有限公司 | 礼至家居-全屋定制家具_一站式全屋整装_免费量房设计报价 | 河南道路标志牌_交通路标牌_交通标志牌厂家-郑州路畅交通 | 派克防爆伺服电机品牌|国产防爆伺服电机|高低温伺服电机|杭州摩森机电科技有限公司 | 深圳诚暄fpc首页-柔性线路板,fpc柔性线路板打样生产厂家 | 实体店商新零售|微赢|波后|波后合作|微赢集团 | 杭州厂房降温,车间降温设备,车间通风降温,厂房降温方案,杭州嘉友实业爽风品牌 | 雷冲击高压发生器-水内冷直流高压发生器-串联谐振分压器-武汉特高压电力科技有限公司 | 纸塑分离机-纸塑分离清洗机设备-压力筛-碎浆机厂家金双联环保 | 济南菜鸟驿站广告|青岛快递车车体|社区媒体-抖音|墙体广告-山东揽胜广告传媒有限公司 | 涡轮流量计_LWGY智能气体液体电池供电计量表-金湖凯铭仪表有限公司 | 高压管道冲洗清洗机_液压剪叉式升降机平台厂家-林君机电 | 新疆乌鲁木齐网站建设-乌鲁木齐网站制作设计-新疆远璨网络 |