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

    <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="qwawimqqmiuu" 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() 數(shù)據(jù)類型..它是如何工作的?

        PHP PDO::bindParam() data types.. how does it work?(PHP PDO::bindParam() 數(shù)據(jù)類型..它是如何工作的?)
          <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="qwawimqqmiuu" id='lbLZQ'><tfoot id='lbLZQ'></tfoot><dl id='lbLZQ'><fieldset id='lbLZQ'></fieldset></dl></div>

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

                  問題描述

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

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

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

                  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);
                  

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

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

                  谷歌搜索,我發(fā)現(xiàn)在 php.net 檔案中:

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

                  大家好,

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

                  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我的數(shù)據(jù)庫中的錯誤或整數(shù).但在我的數(shù)據(jù)庫中,我有:

                  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

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

                  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?

                  推薦答案

                  在其他語言的其他數(shù)據(jù)庫抽象框架中,它可用于確保您對內(nèi)聯(lián)值進(jìn)行正確的轉(zhuǎn)義(對于驅(qū)動程序不支持正確的綁定參數(shù))并通過確保數(shù)字被適當(dāng)?shù)囟M(jìn)制打包來提高網(wǎng)絡(luò)效率(給定協(xié)議支持).它看起來像在 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(或者你什么都不說,因為這是默認(rèn)的)并且你的數(shù)據(jù)的內(nèi)部類型是一個 double 那么它會使用一種方法將它變成一個字符串,如果它不是一個double 然后它將使用不同的方法將其轉(zhuǎn)換為字符串.

                  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 那么它會將它轉(zhuǎn)換為 long.

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

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

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

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

                  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.

                  這篇關(guān)于PHP PDO::bindParam() 數(shù)據(jù)類型..它是如何工作的?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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ū)動程序)
                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="qwawimqqmiuu" 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'>

                            主站蜘蛛池模板: 成人三级av | 亚洲精品一区二区三区中文字幕 | 91福利在线导航 | 欧美理论片在线观看 | 国产精品久久久久久久粉嫩 | 精品一区二区电影 | 欧洲视频一区二区 | 一区天堂 | 国产成人福利在线观看 | 亚洲欧美日韩精品久久亚洲区 | 91精品麻豆日日躁夜夜躁 | 在线久草| 亚洲精品视频在线播放 | 天天躁日日躁狠狠躁2018小说 | 亚洲一区二区中文字幕 | 日韩欧美1区2区 | 亚洲一区欧美 | 国产精品高潮呻吟久久aⅴ码 | 久久久夜| 免费观看一级特黄欧美大片 | 97av视频在线观看 | 天天干 夜夜操 | 日韩精品久久久久 | 久久精品国产久精国产 | 五月天综合影院 | 色噜噜亚洲男人的天堂 | 久久高清 | 久久av影院 | 精品国产欧美 | 欧美午夜精品 | 91操操操| 国产精品一级 | 国产一级影片 | 精品欧美一区二区精品久久久 | 久草视频在线播放 | 亚洲精品91| 国产福利一区二区 | 成人久久网 | 91免费在线视频 | xx性欧美肥妇精品久久久久久 | 欧美日韩专区 |