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

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

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

    1. <i id='tpS8l'><tr id='tpS8l'><dt id='tpS8l'><q id='tpS8l'><span id='tpS8l'><b id='tpS8l'><form id='tpS8l'><ins id='tpS8l'></ins><ul id='tpS8l'></ul><sub id='tpS8l'></sub></form><legend id='tpS8l'></legend><bdo id='tpS8l'><pre id='tpS8l'><center id='tpS8l'></center></pre></bdo></b><th id='tpS8l'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='tpS8l'><tfoot id='tpS8l'></tfoot><dl id='tpS8l'><fieldset id='tpS8l'></fieldset></dl></div>
      1. laravel 4:驗證唯一(數據庫)多個 where 子句

        laravel 4: validation unique (database) multiple where clauses(laravel 4:驗證唯一(數據庫)多個 where 子句)

            <bdo id='7Wxdc'></bdo><ul id='7Wxdc'></ul>
            <legend id='7Wxdc'><style id='7Wxdc'><dir id='7Wxdc'><q id='7Wxdc'></q></dir></style></legend>

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

                <tfoot id='7Wxdc'></tfoot>

                    <tbody id='7Wxdc'></tbody>
                • <small id='7Wxdc'></small><noframes id='7Wxdc'>

                • 本文介紹了laravel 4:驗證唯一(數據庫)多個 where 子句的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  laravel 4 文檔提到了獨特的字段驗證.他們在這里解釋了如何將 where 子句包含到唯一驗證中.唯一表的單個 WHERE 子句,例如:

                  The laravel 4 documentation mentions unique field validation. They explain here how to include where clauses to the unique validation. A single WHERE clause for the unique table for example:

                  $validator = Validator::make(
                      array(
                          'name' => 'John Doe'
                      ),
                      array(
                          'name' => 'unique:table,field,NULL,id,field1,value1'
                      )
                  );
                  

                  • http://laravel.com/docs/validation#rule-unique
                  • 現在我假設這會執行以下操作:

                    Now i assume this does something like:

                    "SELECT id FROM table WHERE field = 'John Doe' AND field1 = value1 LIMIT 1"
                    

                    然后檢查此查詢是否返回結果,如果沒有通過驗證器.

                    Then check's if this query returns a result and if not passes the validator.

                    所以我想知道是否有辦法添加更多 where 子句?如果是這樣怎么辦?

                    So i was wondering if there was a way to add more where clauses? And if so how?

                    推薦答案

                    我原來的問題結束:

                    我可以將它們堆疊起來,或者如果沒有,我必須如何編寫驗證?所以我可以添加,field2,value2,field3,value3"等.并將它們堆疊起來像這樣嗎?

                    Can i just stack them or how do i have to write my validation if not? So can i just add ",field2,value2,field3,value3" ect. and stack them like this?

                    回答

                    是的,我可以像下面那樣堆疊它們.因此,如果我想向我的唯一驗證器添加多個 where 子句,我會這樣做:

                    Yes i can just stack them like below. So if i would like to add multiple where clauses to my unique validator i would do it like this:

                    'name' => 'unique:table,field,NULL,id,field1,value1,field2,value2,field3,value3'
                    


                    例外

                    根據 Laravel 文檔

                    The third parameter given in the unique rule is the except parameter, according to the Laravel documentation.

                    unique:table,column,except,idColumn
                    

                    我將此參數保留為 NULL,因為它與原始問題無關.想知道這個NULL在唯一規則中的作用是什么的,讓我詳細說明一下:

                    I left this parameter NULL because it is not that relevant to the original question. For those who would like to know what the function of this NULL is within the unique rule, let me elaborate:

                    except 參數強制一個唯一的規則忽略給定的 ID.因此,將其指定為 NULL 將導致檢查每條記錄(即不忽略任何內容).

                    The except parameter forces a unique rule to ignore a given ID. So specifying it as a NULL will result in checking against every record ( i.e. ignoring nothing ).

                    例如:假設我們希望我們的用戶電子郵件是唯一的,但我們的管理員用戶可能也有一個使用相同電子郵件的普通用戶帳戶.假設我們的管理員用戶是我們創建的第一個用戶,它的 id 為 1.那么我們在創建新用戶時可以做的是:

                    For example: Let's say we want our user email to be unique but our admin user might also have a normal user account with the same email. Assuming our admin user is the first user we created it has the id of 1. So what we could do when creating new users is:

                    'name' => 'unique:users,email,1,id'
                    

                    這篇關于laravel 4:驗證唯一(數據庫)多個 where 子句的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 找不到驅動程序)

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

                      <legend id='lEelk'><style id='lEelk'><dir id='lEelk'><q id='lEelk'></q></dir></style></legend>
                    1. <tfoot id='lEelk'></tfoot>
                        <tbody id='lEelk'></tbody>

                        • <bdo id='lEelk'></bdo><ul id='lEelk'></ul>

                          <i id='lEelk'><tr id='lEelk'><dt id='lEelk'><q id='lEelk'><span id='lEelk'><b id='lEelk'><form id='lEelk'><ins id='lEelk'></ins><ul id='lEelk'></ul><sub id='lEelk'></sub></form><legend id='lEelk'></legend><bdo id='lEelk'><pre id='lEelk'><center id='lEelk'></center></pre></bdo></b><th id='lEelk'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='lEelk'><tfoot id='lEelk'></tfoot><dl id='lEelk'><fieldset id='lEelk'></fieldset></dl></div>
                            主站蜘蛛池模板: 国产精品精品久久久 | 欧产日产国产精品国产 | 国产成人在线视频免费观看 | 国产午夜三级一区二区三 | 一区中文字幕 | 久久久久久久久久久蜜桃 | 久久久天天 | 亚洲精品国产a久久久久久 午夜影院网站 | 国产精品夜间视频香蕉 | 91中文视频| 国产精品www| 人人操日日干 | 久久精品国产一区二区三区 | 一区二区三区视频在线观看 | 丝袜 亚洲 欧美 日韩 综合 | 精品久久99 | 中文字幕不卡一区 | 中文字幕视频在线观看 | 亚洲精品久久久久久久久久久 | 久久伊人影院 | 国产高清自拍视频在线观看 | 日韩中文字幕一区 | 日韩字幕一区 | 国产日韩91| 先锋资源站| 久久综合狠狠综合久久综合88 | 人人爽人人草 | 精品久久国产 | 国产欧美日韩一区 | 日韩欧美国产一区二区 | 久久精品中文 | 日本精品在线观看 | 日韩一区二区三区视频在线播放 | 韩日一区二区 | 中文字幕亚洲无线 | 欧美激情精品久久久久久 | www日日日| 欧美一级在线 | 三级黄色片在线 | 欧美性猛交一区二区三区精品 | 久久69精品久久久久久久电影好 |