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

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

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

      1. PDO SQL 狀態(tài)“00000"但仍然錯誤?

        PDO SQL-state quot;00000quot; but still error?(PDO SQL 狀態(tài)“00000但仍然錯誤?)
        • <bdo id='swl3D'></bdo><ul id='swl3D'></ul>
          <i id='swl3D'><tr id='swl3D'><dt id='swl3D'><q id='swl3D'><span id='swl3D'><b id='swl3D'><form id='swl3D'><ins id='swl3D'></ins><ul id='swl3D'></ul><sub id='swl3D'></sub></form><legend id='swl3D'></legend><bdo id='swl3D'><pre id='swl3D'><center id='swl3D'></center></pre></bdo></b><th id='swl3D'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='swl3D'><tfoot id='swl3D'></tfoot><dl id='swl3D'><fieldset id='swl3D'></fieldset></dl></div>

          • <legend id='swl3D'><style id='swl3D'><dir id='swl3D'><q id='swl3D'></q></dir></style></legend>

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

              <tbody id='swl3D'></tbody>

              <tfoot id='swl3D'></tfoot>

                1. 本文介紹了PDO SQL 狀態(tài)“00000"但仍然錯誤?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  誰能解釋一下原因

                  $sql->execute($params);
                  

                  返回FALSE,而

                  print $pdo->errorCode();
                  print_r($pdo->errorInfo());
                  

                  都返回SQLSTATE 00000,表示根據(jù)文檔成功?它是一個 INSERT 并且實際上沒有將任何內(nèi)容插入到數(shù)據(jù)庫中...那么,為什么我會從 SQLSTATE 收到成功消息?

                  both return SQLSTATE 00000, which means according to the documentation success? It is an INSERT and nothing is actually being inserted into the database... so, why do I get a success message from SQLSTATE?

                  如果有幫助,這是代碼...

                  In case it helps, this is the code...

                  $sql = $pdo->prepare("
                          INSERT INTO user (
                              username, fname, pass, salt, email,
                              loc_id_home, country_id_home, region_id_home,
                              cont_id_home, timestamp_reg, timestamp_upd, timestamp_lastonline, 
                              online_status, gender, birthdate
                              )
                          VALUES (
                              :username,:fname,:pass,:random_salt,:email,
                              :loc_id_home,:country_id_home,:region_id_home,
                              :cont_id_home,'".time()."','".time()."','".time()."',
                              1,:gender,:birthdate)
                          ");
                  
                  $params=array(
                      ':username'=>$username,
                      ':fname'=>$fname,
                      ':pass'=>$pass,
                      ':random_salt'=>$random_salt,
                      ':email'=>$email,
                      ':loc_id_home'=>$loc_id_home,
                      ':country_id_home'=>$country,
                      ':region_id_home'=>$region,
                      ':cont_id_home'=>$continent,
                      ':gender'=>$gender,
                      ':birthdate'=>$birthdate
                  );  
                  
                  $sql->execute($params);
                  
                  print $pdo->errorCode();
                  print_r($pdo->errorInfo());
                  

                  推薦答案

                  這是因為 $pdo->errorInfo() 指的是最后一條成功執(zhí)行的語句.由于 $sql->execute() 返回 false,所以它不能引用該語句(要么不引用,要么引用之前的查詢).

                  It is because $pdo->errorInfo() refers to the last statement that was successfully executed. Since $sql->execute() returns false, then it cannot refer to that statement (either to nothing or to the query before).

                  至于為什么 $sql->execute() 返回 false,我不知道...要么是您的 $params 數(shù)組有問題,要么與您的數(shù)據(jù)庫連接.

                  As to why $sql->execute() returns false, I don't know... either there is a problem with your $params array or with your database connection.

                  PDO::errorCode — 獲取與數(shù)據(jù)庫句柄上的最后一個操作相關(guān)聯(lián)的 SQLSTATE

                  PDO::errorCode — Fetch the SQLSTATE associated with the last operation on the database handle

                  注意:PHP 手冊(http://php.net/manual/en/pdo.errorinfo.php) 并沒有準確定義對數(shù)據(jù)庫句柄的最后操作"是什么意思,但是如果綁定參數(shù)存在問題,那么該錯誤就會發(fā)生在 PDO 內(nèi)部,并且不會與數(shù)據(jù)庫進行任何交互.可以肯定地說,如果 $pdo->execute() 返回 true,則 $pdo->errorInfo() 是有效的.如果 $pdo->execute() 返回 false,則 $pdo->errorInfo() 的行為沒有從文檔.如果我的經(jīng)驗沒有記錯的話,execute 返回 true,即使 MySQL 返回錯誤,如果未執(zhí)行任何操作,則返回 false.由于文檔不是特定的,它可能是特定于數(shù)據(jù)庫驅(qū)動程序的.

                  Note: The PHP manual (http://php.net/manual/en/pdo.errorinfo.php) does not define exactly what "last operation on the database handle" means, but if there was an issue with binding parameters, that error would have occurred inside PDO and without any interaction with the database. It is safe to say that if $pdo->execute() returns true, that $pdo->errorInfo() is valid. If $pdo->execute() returns false, the behavior of $pdo->errorInfo() is not explicitly clear from the documentation. If I recall correctly from my experience, execute returns true, even if MySQL returned an error, returns false if no operation was done. Since the documentation is not specific, it might be db driver specific.

                  此答案反映了截至 2012 年 9 月撰寫時的實際經(jīng)驗.正如用戶所指出的,文檔并未明確重申這種解釋.它也可能只反映特定的數(shù)據(jù)庫驅(qū)動程序?qū)崿F(xiàn),但如果 $pdo->execute() 返回 true,則 $pdo 應(yīng)該總是正確的->errorInfo() 有效.

                  This answer reflects practical experience as of when it was written in September 2012. As a user has pointed out, the documentation does not explicitly reaffirm this interpretation. It also may only reflect the particular database driver implementation, but it should always be true that if $pdo->execute() returns true, that $pdo->errorInfo() is valid.

                  您可能還想在連接序列中設(shè)置 PDO::ERRMODE_EXCEPTION.異常處理使得不需要檢查和查詢錯誤.

                  You might also want to set PDO::ERRMODE_EXCEPTION in your connect sequence. Exception handling makes it unnecessary to check and query the error.

                  $dbh->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
                  

                  這篇關(guān)于PDO SQL 狀態(tài)“00000"但仍然錯誤?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 可滾動游標不起作用)
                  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ū)動程序)
                  <tfoot id='zufeF'></tfoot>

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

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

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

                          • <small id='zufeF'></small><noframes id='zufeF'>

                            主站蜘蛛池模板: 中文字幕影院 | 国产精品成人一区二区三区 | 五月综合久久 | 亚洲国产精品久久久 | 在线观看中文字幕 | 久久99精品久久久久久噜噜 | 国产精品7777777 | 精品久久香蕉国产线看观看亚洲 | 久久久久久久97 | 999久久久久久久久6666 | 一区二区影院 | av大片 | 黑人中文字幕一区二区三区 | 免费一级黄色 | 亚洲高清视频一区二区 | 中文字幕精品一区久久久久 | 国产999精品久久久久久 | 亚洲成人播放器 | 福利视频亚洲 | 国产一区在线免费 | 亚洲性视频网站 | 久久久成人精品 | 日韩免费网站 | 天天操,夜夜爽 | 欧美一区二区另类 | 国产午夜精品一区二区三区四区 | 91深夜福利视频 | 国产成人精品a视频一区www | 免费在线观看成年人视频 | 男女免费观看在线爽爽爽视频 | 在线观看亚洲专区 | 亚洲精品自在在线观看 | 亚洲欧美日韩高清 | 午夜影院在线观看版 | 91大神在线看 | 久久激情视频 | 久久久久久久av | 欧美成人免费在线 | 国产精品久久二区 | 色综网 | 人人爽日日躁夜夜躁尤物 |