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

    <bdo id='ylWNH'></bdo><ul id='ylWNH'></ul>
<tfoot id='ylWNH'></tfoot>

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

    2. <legend id='ylWNH'><style id='ylWNH'><dir id='ylWNH'><q id='ylWNH'></q></dir></style></legend>

    3. <i id='ylWNH'><tr id='ylWNH'><dt id='ylWNH'><q id='ylWNH'><span id='ylWNH'><b id='ylWNH'><form id='ylWNH'><ins id='ylWNH'></ins><ul id='ylWNH'></ul><sub id='ylWNH'></sub></form><legend id='ylWNH'></legend><bdo id='ylWNH'><pre id='ylWNH'><center id='ylWNH'></center></pre></bdo></b><th id='ylWNH'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ylWNH'><tfoot id='ylWNH'></tfoot><dl id='ylWNH'><fieldset id='ylWNH'></fieldset></dl></div>
    4. ZF2 如何 orWhere()

      ZF2 How to orWhere()(ZF2 如何 orWhere())

          <tfoot id='VQreL'></tfoot>

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

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

                <bdo id='VQreL'></bdo><ul id='VQreL'></ul>
              • 本文介紹了ZF2 如何 orWhere()的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                我想弄清楚如何在 where 子句中使用 OR 進(jìn)行 Mysql Select.默認(rèn)情況下,where 語句中的所有子句都是 AND 運(yùn)算的,經(jīng)過幾個(gè)小時(shí)的嘗試和失敗,查看網(wǎng)絡(luò)無法使其工作.在 ZF1 中它將是 orWhere() 但在 ZF2 中沒有.

                I am trying to figure out how to make a Mysql Select with an OR in where Clause. By default all clauses in where statement are ANDed and after some hours of try and fail and looking the net can't make it work. In ZF1 it would be an orWhere() but there is not in ZF2.

                這是我在 AbstracttableGateway 中的代碼:

                This is the code i have inside a AbstracttableGateway:

                $resultSet = $this->select(function (Select $select) use ($searchstring) {
                             $select->join('users','blog_posts.id_user = users.id',array('name'))
                                    ->join('blog_categories','blog_posts.id_category = blog_categories.id', array(
                                                           'cat_name'   => 'name',
                                                           'cat_alias' => 'alias',
                                                           'cat_image'  => 'icon'))
                                    ->order('date DESC');
                                    //->where("title LIKE '%" .$searchstring . "%' OR content LIKE '%". $searchstring ."%'")
                            $select->where->like('content','%'.$searchstring.'%');
                            $select->where->like('title','%'.$searchstring.'%');
                        }
                    );
                    return $resultSet;
                

                帶有 $select->where->like 的行是 AND 運(yùn)算的,我希望它們帶有 OR.我應(yīng)該改變什么?

                the lines with the $select->where->like are the ones that are ANDed and I want them with OR. What should I change?

                推薦答案

                ZF2 中沒有 orWhere,但你可以使用 ZendDbSqlPredicate 的任意組合代碼>對(duì)象.對(duì)于 OR,在 PredicateSetPredicateSet::COMBINED_BY_OR 中使用 2 個(gè)謂詞.

                There is no orWhere in ZF2, but you could use any combination of ZendDbSqlPredicate objects. For OR use 2 predicates in a PredicateSet with PredicateSet::COMBINED_BY_OR.

                關(guān)于它的文檔不多,但您可以瀏覽源代碼 - 現(xiàn)在.

                There's not much documentation for it, but you could browse the source - for now.

                編輯:示例

                use ZendDbSqlPredicate;
                
                $select->where(array(
                    // ...
                    new PredicatePredicateSet(
                        array(
                            new PredicateLike('content', '%'.$searchstring.'%'),
                            new PredicateLike('title', '%'.$searchstring.'%'),
                        ),
                        PredicatePredicateSet::COMBINED_BY_OR
                    ),
                    // ...
                ));
                

                這篇關(guān)于ZF2 如何 orWhere()的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(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 可滾動(dòng)游標(biāo)不起作用)
                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 獲取一個(gè)值;等于變量的值)
                MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動(dòng)程序)

                          <tbody id='h0PFl'></tbody>

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

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

                          主站蜘蛛池模板: 欧美黑人一区 | 中文字幕1区2区3区 日韩在线视频免费观看 | 精品免费国产视频 | 国产九九九九 | 一级片免费观看 | 日韩不卡视频在线 | 日韩成人免费视频 | 蜜桃黄网| 在线免费小视频 | 日韩精品在线播放 | 91精品国产91久久综合桃花 | 伊人性伊人情综合网 | 日韩一区二区在线看 | 韩国av一区二区 | 亚洲激情专区 | 欧美在线观看网站 | 欧美老妇交乱视频 | 中文字幕一区在线观看视频 | 成人九色 | 日韩成人免费中文字幕 | 国产亚洲精品a | 久久999 | 欧美一区二区在线观看 | 国产免费福利 | 91综合网| 成人一区二区三区视频 | 日韩成人精品一区二区三区 | 国产精品久久久久久福利一牛影视 | 狠狠色综合网站久久久久久久 | av资源网站 | 亚洲 一区 | 日韩伦理一区二区三区 | 亚洲性视频 | 天天看天天操 | 在线视频 亚洲 | 亚洲欧美日韩久久 | 国产精品久久久久久久久久三级 | 偷拍自拍网站 | 懂色tv | 欧美激情国产日韩精品一区18 | 综合二区 |