久久久久久久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>

                          主站蜘蛛池模板: 成人精品国产一区二区4080 | 久久午夜国产精品www忘忧草 | 影音av| 99精品视频网 | 国产精品激情 | 久久中文字幕一区 | 久久精品综合 | 91一区二区三区 | 国产精品久久久久久久 | 欧美三区在线观看 | 成人av在线网站 | 国精品一区二区 | 亚洲欧美综合精品久久成人 | 国产在线视频在线观看 | 欧美精品片 | 四虎影视免费在线 | 精品免费视频 | 久久高清 | 一区二区不卡高清 | 成人国产一区二区三区精品麻豆 | 蜜桃视频一区二区三区 | 成人av一区二区三区 | 麻豆久久久久久久久久 | 欧美日韩专区 | 亚洲精品一区二三区不卡 | 久久久国产精品 | 久久中文字幕电影 | 午夜精品久久久久久久久久久久久 | 婷婷开心激情综合五月天 | 日韩视频二区 | 国产午夜精品久久久久 | 一级毛片视频免费观看 | 男女午夜免费视频 | 成人黄在线观看 | 在线中文字幕av | 99久久婷婷国产综合精品首页 | 日皮视频免费 | 精品国产乱码久久久久久图片 | 精品一区二区三区四区 | 一级黄色片网站 | 日本三级在线视频 |