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

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

        <tfoot id='51kv6'></tfoot>

      2. 可捕獲的致命錯誤:無法在第 114 行將類 PDOStatem

        Catchable fatal error: Object of class PDOStatement could not be converted to string in line 114(可捕獲的致命錯誤:無法在第 114 行將類 PDOStatement 的對象轉換為字符串)
            • <bdo id='RtL0l'></bdo><ul id='RtL0l'></ul>
              <i id='RtL0l'><tr id='RtL0l'><dt id='RtL0l'><q id='RtL0l'><span id='RtL0l'><b id='RtL0l'><form id='RtL0l'><ins id='RtL0l'></ins><ul id='RtL0l'></ul><sub id='RtL0l'></sub></form><legend id='RtL0l'></legend><bdo id='RtL0l'><pre id='RtL0l'><center id='RtL0l'></center></pre></bdo></b><th id='RtL0l'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='RtL0l'><tfoot id='RtL0l'></tfoot><dl id='RtL0l'><fieldset id='RtL0l'></fieldset></dl></div>
              <tfoot id='RtL0l'></tfoot>

                <tbody id='RtL0l'></tbody>

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

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

                  本文介紹了可捕獲的致命錯誤:無法在第 114 行將類 PDOStatement 的對象轉換為字符串的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試將一些數據添加到我的數據庫中,但我收到錯誤 Catchable fatal error: Object of class PDOStatement could not be convert to string in/var/www/mandje.php 第 114 行.這是我正在使用的代碼:

                  I'm trying to add some data to my database, but I'm getting the error Catchable fatal error: Object of class PDOStatement could not be converted to string in /var/www/mandje.php on line 114. This is the code I'm using:

                   foreach($_SESSION["cart"] as $id => $value){
                  
                          $query = $db->query('SELECT * FROM Producten WHERE ProductID ="'.$id.'" ');
                          $query->execute();
                  
                          while($row = $query->fetch(PDO::FETCH_ASSOC)){
                              $price = $row['Prijs'];
                              $ProductID = $row['ProductID'];
                              }
                          $sql="INSERT INTO Bestellingsdetail( Bestelnummer, ProductID, Aantal, Prijs)
                          VALUES ($max,$ProductID,$value,$price)";      //<---- line 114
                          $count = $db->execute($sql);
                  

                  我真的不明白這里出了什么問題.任何幫助將不勝感激:)

                  I don't really get what's going wrong here. Any help would be much appreciated :)

                  推薦答案

                  在評論中,您顯示以下內容:

                  In the comments, you show the following:

                  $query = $db->query('SELECT MAX( Bestelnummer ) FROM Bestellingsdetail');
                  $query->execute();
                  $max = $query;
                  $max++;
                  

                  這不是您從查詢中獲得結果的方式.您正在將 $max 設置為 PDOStatement 對象.您需要 fetch() 結果才能使用它.

                  This is not how you get the result from a query. You are setting $max to a PDOStatement object. You need to fetch() the result in order to use it.

                  // I've added "AS maxval" to make it easier to get the row
                  $query = $db->query('SELECT MAX(Bestelnummer) AS maxval FROM Bestellingsdetail');
                  $max_row = $query->fetch(PDO::FETCH_ASSOC);
                  
                  $max = $max_row['maxval'];
                  $max++;
                  

                  文檔:http://www.php.net/pdo.query

                  附言$query->execute(); 只有準備好的語句才需要.query() 將立即執行查詢.

                  P.S. $query->execute(); is only needed for prepared statements. query() will execute the query immediately.

                  這篇關于可捕獲的致命錯誤:無法在第 114 行將類 PDOStatement 的對象轉換為字符串的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  MySQLi prepared statement amp; foreach loop(MySQLi準備好的語句amp;foreach 循環)
                  Is mysqli_insert_id() gets record from whole server or from same user?(mysqli_insert_id() 是從整個服務器還是從同一用戶獲取記錄?)
                  PHP MySQLi doesn#39;t recognize login info(PHP MySQLi 無法識別登錄信息)
                  mysqli_select_db() expects exactly 2 parameters(mysqli_select_db() 需要 2 個參數)
                  Php mysql pdo query: fill up variable with query result(Php mysql pdo 查詢:用查詢結果填充變量)
                  MySQLI 28000/1045 Access denied for user #39;root#39;@#39;localhost#39;(MySQLI 28000/1045 用戶“root@“localhost的訪問被拒絕)
                1. <tfoot id='h4Ufr'></tfoot>
                  <legend id='h4Ufr'><style id='h4Ufr'><dir id='h4Ufr'><q id='h4Ufr'></q></dir></style></legend>

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

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

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

                          • 主站蜘蛛池模板: av网站在线播放 | 亚洲精品片 | 韩国精品在线观看 | 久久99精品久久久久久琪琪 | 精品国产精品一区二区夜夜嗨 | 久久最新网址 | 三级视频国产 | 国产美女视频黄 | 久久亚洲一区 | 日本天堂视频在线观看 | 亚洲欧美综合精品久久成人 | 国产精品高潮呻吟久久 | 久久久av| 成人精品一区二区三区 | 日韩欧美一二三区 | 在线观看中文视频 | 欧美一级小视频 | 国产成人精品综合 | 日本特黄a级高清免费大片 国产精品久久性 | 欧美一区二区三区的 | 欧美日韩中文国产一区发布 | 精品视频导航 | 久久一区二区三区四区五区 | 色爱综合 | 国产精品久久久久久婷婷天堂 | 国产精品成人一区二区 | 久久精品久久久久久 | 欧美精品a∨在线观看不卡 欧美日韩中文字幕在线播放 | 欧美亚洲另类丝袜综合网动图 | 亚洲综合在线网 | 一区二区三区四区av | 久久精品91久久久久久再现 | 久久精品亚洲成在人线av网址 | 日韩理论电影在线观看 | 亚洲高清在线 | 天天操网 | 国产精品99久久久久久宅男 | 高清视频一区二区三区 | 日本免费一区二区三区 | 久久国产精品偷 | 日本 欧美 国产 |