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

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

        <legend id='bYDFg'><style id='bYDFg'><dir id='bYDFg'><q id='bYDFg'></q></dir></style></legend>
        <tfoot id='bYDFg'></tfoot>
        • <bdo id='bYDFg'></bdo><ul id='bYDFg'></ul>

        lastInsertId 在 Postgresql 中不起作用

        lastInsertId does not work in Postgresql(lastInsertId 在 Postgresql 中不起作用)
          <tbody id='WRmiL'></tbody>

              <tfoot id='WRmiL'></tfoot>

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

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

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

                  本文介紹了lastInsertId 在 Postgresql 中不起作用的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我使用的是 Postgresql,當我想使用 PDO 來檢索最新的插入 ID 時,我遇到了問題.這是我的代碼:

                  I am using Postgresql, when I want to use PDO to retrieve the latest insertion ID, I got a problem. Here is my code:

                  $db->lastInsertId('columnName');
                  

                  錯誤信息說

                  SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "columnName" does not exist
                  

                  我想我對 PHP 手冊中所述的序列對象"有些誤解.

                  I guess I have some misunderstanding about "sequence object" stated in the PHP Manual.

                  Note:
                  
                  Returns the ID of the last inserted row, or the last value from a sequence object, 
                  depending on the underlying driver. For example, PDO_PGSQL() requires you to specify the 
                  name of a sequence object for the name parameter.
                  

                  目前,columnName"是該自增屬性的字符串.誰能指出我哪里出錯了?謝謝.

                  Currently, the "columnName" is the string of that auto-incremented attribute. Can anyone point out where I went wrong? Thanks.

                  推薦答案

                  PostgreSQL 使用 序列 為serial 列和 serial 列通常用于 PostgreSQL 中的自動遞增"列.序列有名稱,并且通常獨立于任何特定的表,因此您可以使用一個序列為多個不同的表生成唯一的 ID;序列名稱是 lastInsertId 想要作為其參數的名稱:

                  PostgreSQL uses sequences to generate values for serial columns and serial columns are generally what is used for "auto-incrementing" columns in PostgreSQL. Sequences have names and are, in general, independent of any particular table so you could have one sequence generating unique IDs for several different tables; the sequence name is what lastInsertId wants as its argument:

                  例如,PDO_PGSQL() 要求您為 name 參數指定序列對象的名稱.

                  For example, PDO_PGSQL() requires you to specify the name of a sequence object for the name parameter.

                  PostgreSQL創建的序列對象自動命名為[table]_[column]_seq,所以:

                  The sequence object created by PostgreSQL is automatically named [table]_[column]_seq, So:

                  $id = $db->lastInsertId('tableName_columnName_seq');
                  

                  這篇關于lastInsertId 在 Postgresql 中不起作用的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 找不到驅動程序)
                  <i id='Y6imd'><tr id='Y6imd'><dt id='Y6imd'><q id='Y6imd'><span id='Y6imd'><b id='Y6imd'><form id='Y6imd'><ins id='Y6imd'></ins><ul id='Y6imd'></ul><sub id='Y6imd'></sub></form><legend id='Y6imd'></legend><bdo id='Y6imd'><pre id='Y6imd'><center id='Y6imd'></center></pre></bdo></b><th id='Y6imd'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Y6imd'><tfoot id='Y6imd'></tfoot><dl id='Y6imd'><fieldset id='Y6imd'></fieldset></dl></div>

                    1. <legend id='Y6imd'><style id='Y6imd'><dir id='Y6imd'><q id='Y6imd'></q></dir></style></legend>
                          <bdo id='Y6imd'></bdo><ul id='Y6imd'></ul>

                        • <tfoot id='Y6imd'></tfoot>
                            <tbody id='Y6imd'></tbody>

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

                            主站蜘蛛池模板: 天天干狠狠操 | 亚洲欧美一区二区三区情侣bbw | 日韩免费视频一区二区 | 欧美日韩国产一区二区三区 | 在线看亚洲 | 成人免费在线视频 | 91在线一区 | 91视频正在播放 | 夜久久 | 欧美在线视频网 | 中文视频在线 | 老牛影视av一区二区在线观看 | 日韩中文字幕 | 天天综合国产 | 成人精品一区二区三区中文字幕 | 中文字幕在线一区 | av免费网址 | 一级黄色片美国 | 欧美中文字幕在线观看 | 狠狠干美女 | 欧美福利在线 | jlzzjlzz国产精品久久 | 欧美精品a∨在线观看不卡 国产精品久久国产精品 | 欧美精品一区二区免费视频 | 成人不卡| 亚洲二区视频 | 欧美精品国产精品 | 日本免费在线看 | 2021天天干夜夜爽 | 97伊人| 精品国偷自产在线 | 99re| 久草网站 | 免费在线观看av | 国产黄色网 | 欧美中文字幕一区二区三区 | 日韩三区在线观看 | 精品人伦一区二区三区蜜桃网站 | 91在线观看视频 | www.9191| 亚洲不卡视频 |