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

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

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

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

        PDO 錯誤 - PDOException' 帶有消息 'SQLSTATE[HY0

        PDO Error - PDOException#39; with message #39;SQLSTATE[HY000]: General error#39;(PDO 錯誤 - PDOException 帶有消息 SQLSTATE[HY000]: 一般錯誤)
        <i id='D7TaY'><tr id='D7TaY'><dt id='D7TaY'><q id='D7TaY'><span id='D7TaY'><b id='D7TaY'><form id='D7TaY'><ins id='D7TaY'></ins><ul id='D7TaY'></ul><sub id='D7TaY'></sub></form><legend id='D7TaY'></legend><bdo id='D7TaY'><pre id='D7TaY'><center id='D7TaY'></center></pre></bdo></b><th id='D7TaY'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='D7TaY'><tfoot id='D7TaY'></tfoot><dl id='D7TaY'><fieldset id='D7TaY'></fieldset></dl></div>
          <tbody id='D7TaY'></tbody>
          <bdo id='D7TaY'></bdo><ul id='D7TaY'></ul>

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

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

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

                1. 本文介紹了PDO 錯誤 - PDOException' 帶有消息 'SQLSTATE[HY000]: 一般錯誤'的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我收到此錯誤:

                  Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error' in ...
                  

                  ...每當我使用 PDO 執行此代碼時:

                  ..whenever I execute this code with PDO:

                  //Select data from the topic.
                  $s = $dbh->prepare("SELECT * FROM forum_topics WHERE forum_id=:forum_cat_id AND topic_id=:topicid");
                  $s->bindParam(':forum_cat_id', $forum_cat_id);
                  $s->bindParam(':topicid', $topicid);
                  $s->execute();
                  $f = $s->fetch();
                  
                  $s = $dbh->prepare("UPDATE forum_cats 
                      SET 
                          forum_last_postid = :last_post_id, forum_last_posttime = :time, 
                          forum_last_userid = :userid, forum_last_username = :username, 
                          forum_posts=forum_posts+1 
                      WHERE forum_id = :forum_cat_id");
                  $s->bindParam(':last_post_id', $last_post_id);
                  $s->bindParam(':time', $time);
                  $s->bindParam(':userid', $userid);
                  $s->bindParam(':username', $userdata['username']);
                  $s->bindParam(':forum_cat_id', $forum_cat_id);
                  try {
                      $s->execute();
                  }
                  catch(PDOException $e) {
                      die($e->getMessage());
                  }
                  
                  if (count($s->fetchAll()) == 0) {
                      return 3;
                  }
                  

                  我不知道為什么會這樣.我已經檢查了查詢,但我根本找不到任何錯誤..

                  I have no idea why this is happening. I've checked the query, and I simply cant find any errors..

                  推薦答案

                  事情是這樣的:

                  • 您正在嘗試獲取 UPDATE 查詢.您不能這樣做,因為 UPDATE 查詢不返回值.如果您想知道查詢影響了多少行,請改用 rowCount() 函數.請注意,并非所有數據庫驅動程序都提供受影響的行.

                  • You are trying to fetch an UPDATE query. You can't do that because UPDATE queries does not return values. If you wish to know how many rows were affected by the query, use the rowCount() function instead. Notice that not all DB Drivers provide the affected rows.

                  您正在使用未聲明的變量(至少在您在這里發布的代碼中).這不是此特定錯誤的原因,但可能會產生其他錯誤.

                  You are using undeclared variables (at least in the code you posted here). This isn't the reason for this particular error, but could generate others.

                  您沒有使用從數據庫中選擇的數據

                  You're not using the data you have selected from the database

                  另外,建議在try塊內進行所有PDO操作,否則可能會得到未處理的異常.

                  Also, it is recommended to make all PDO operations within the try block, otherwise you may get unhandled exceptions.

                  這篇關于PDO 錯誤 - PDOException' 帶有消息 'SQLSTATE[HY000]: 一般錯誤'的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 找不到驅動程序)
                2. <tfoot id='eWBxm'></tfoot>

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

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

                            主站蜘蛛池模板: 天天干天天操天天爽 | 欧美 日韩精品 | 欧美成视频在线观看 | 日韩一区二区三区在线观看 | 三级av在线 | 黑人巨大精品欧美一区二区一视频 | 女朋友的闺蜜3韩国三级 | 91精品国产综合久久久久久丝袜 | 久久久久亚洲精品国产 | 欧洲尺码日本国产精品 | 免费亚洲成人 | xxx国产精品视频 | 亚洲国产精品久久 | www.国产精 | 国产精品色 | 免费黄视频网站 | 日韩在线综合 | 亚洲视频欧美视频 | 亚洲精品一区中文字幕乱码 | 中文字幕国产一区 | 中文字幕国产 | 亚洲成人av在线播放 | 午夜视频导航 | 日韩网站在线观看 | 亚洲一区中文字幕在线观看 | 99久久久久国产精品免费 | 亚洲综合一区二区三区 | 欧美日韩亚洲在线 | 人人天天操 | h片在线免费看 | 亚州中文| 亚洲国产视频一区二区 | 欧美日韩精品一区二区三区四区 | 国产精品久久久久久婷婷天堂 | 久久精品视频一区二区 | 国产黄色在线观看 | 美女一级毛片 | 91精品国产综合久久久久久 | 精品久久亚洲 | 欧美激情精品久久久久久 | 亚洲精品在线播放 |