• <tfoot id='lZS1x'></tfoot>

    <legend id='lZS1x'><style id='lZS1x'><dir id='lZS1x'><q id='lZS1x'></q></dir></style></legend>

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

    • <bdo id='lZS1x'></bdo><ul id='lZS1x'></ul>
    <i id='lZS1x'><tr id='lZS1x'><dt id='lZS1x'><q id='lZS1x'><span id='lZS1x'><b id='lZS1x'><form id='lZS1x'><ins id='lZS1x'></ins><ul id='lZS1x'></ul><sub id='lZS1x'></sub></form><legend id='lZS1x'></legend><bdo id='lZS1x'><pre id='lZS1x'><center id='lZS1x'></center></pre></bdo></b><th id='lZS1x'></th></span></q></dt></tr></i><div id='lZS1x'><tfoot id='lZS1x'></tfoot><dl id='lZS1x'><fieldset id='lZS1x'></fieldset></dl></div>

      1. 教义——还是在哪里?

        时间:2024-08-09

          <tbody id='g7gko'></tbody>
        • <bdo id='g7gko'></bdo><ul id='g7gko'></ul>

          <i id='g7gko'><tr id='g7gko'><dt id='g7gko'><q id='g7gko'><span id='g7gko'><b id='g7gko'><form id='g7gko'><ins id='g7gko'></ins><ul id='g7gko'></ul><sub id='g7gko'></sub></form><legend id='g7gko'></legend><bdo id='g7gko'><pre id='g7gko'><center id='g7gko'></center></pre></bdo></b><th id='g7gko'></th></span></q></dt></tr></i><div id='g7gko'><tfoot id='g7gko'></tfoot><dl id='g7gko'><fieldset id='g7gko'></fieldset></dl></div>
              • <tfoot id='g7gko'></tfoot>

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

                  <legend id='g7gko'><style id='g7gko'><dir id='g7gko'><q id='g7gko'></q></dir></style></legend>

                  本文介绍了教义——还是在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有以下疑问:

                  $query = Doctrine_Query::create()
                                  ->from('Member m')
                                      ->where("m.type='1'")
                                          ->andWhere("m.name LIKE '%$term%'")
                                          ->orWhere("m.surname LIKE '%$term%'")
                                          ->orWhere("m.company LIKE '%$term%'")
                                          ->orderBy('id DESC');
                  

                  但它并没有像我想要的那样工作——它忽略了 type 列.

                  But it's not working like I want — it is ignoring type column.

                  我需要的是结果集,其中 m.type=1 和此查询中的其他一些字段是 LIKE 'something'.

                  What I need is result set where m.type=1 and some of other fields in this query is LIKE 'something'.

                  推荐答案

                  $query = Doctrine_Query::create()
                    ->from('Member m')
                    ->where('m.type = 1 AND m.name LIKE ?', '%'.$term.'%')
                    ->orWhere('m.type = 1 AND m.surname LIKE ?', '%'.$term.'%')
                    ->orWhere('m.type = 1 AND m.company LIKE ?', '%'.$term.'%')
                    ->orderBy('m.id DESC');
                  

                  您的 OR 条件不包括第一个条件.还建议对变量使用 ? 以确保 Doctrine 对它们进行转义.

                  Your OR conditions didn't include the first condition. It's also recommended to use the ? for your variables to ensure Doctrine escapes them.

                  这篇关于教义——还是在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:学说:扩展实体类 下一篇:Zend 框架 2 + 教义 2

                  相关文章

                    <legend id='RlZa2'><style id='RlZa2'><dir id='RlZa2'><q id='RlZa2'></q></dir></style></legend>

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

                    1. <i id='RlZa2'><tr id='RlZa2'><dt id='RlZa2'><q id='RlZa2'><span id='RlZa2'><b id='RlZa2'><form id='RlZa2'><ins id='RlZa2'></ins><ul id='RlZa2'></ul><sub id='RlZa2'></sub></form><legend id='RlZa2'></legend><bdo id='RlZa2'><pre id='RlZa2'><center id='RlZa2'></center></pre></bdo></b><th id='RlZa2'></th></span></q></dt></tr></i><div id='RlZa2'><tfoot id='RlZa2'></tfoot><dl id='RlZa2'><fieldset id='RlZa2'></fieldset></dl></div>
                      <tfoot id='RlZa2'></tfoot>
                      • <bdo id='RlZa2'></bdo><ul id='RlZa2'></ul>