<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                where() think\db class Query * * * * * ~~~ /** * 指定AND查詢條件 * @access public * @param mixed $field 查詢字段 * @param mixed $op 查詢表達式 * @param mixed $condition 查詢條件 * @return $this */ public function where($field, $op = null, $condition = null) { $param = func_get_args(); array_shift($param); $this->parseWhereExp('AND', $field, $op, $condition, $param); return $this; } ~~~ * * * * * 以下內容摘自《thinkPHP5完全開發手冊》 > where方法的用法是ThinkPHP查詢語言的精髓,也是ThinkPHP ORM的重要組成部分和亮點所在,可以完成包括普通查詢、表達式查詢、快捷查詢、區間查詢、組合查詢在內的查詢操作。where方法的參數支持字符串和數組,雖然也可以使用對象但并不建議。 表達式查詢 新版的表達式查詢采用全新的方式,查詢表達式的使用格式: ~~~ Db::table('think_user') ->where('id','>',1) ->where('name','thinkphp') ->select(); ~~~ 更多的表達式查詢語法,可以參考查詢語法部分。 數組條件 可以通過數組方式批量設置查詢條件。 普通查詢 最簡單的數組查詢方式如下: ~~~ $map['name'] = 'thinkphp'; $map['status'] = 1; // 把查詢條件傳入查詢方法 Db::table('think_user')->where($map)->select(); // 助手函數 db('user')->where($map)->select(); 最后生成的SQL語句是 SELECT * FROM think_user WHERE `name`='thinkphp' AND status=1 ~~~ 表達式查詢 可以在數組條件中使用查詢表達式,例如: ~~~ $map['id'] = ['>',1]; $map['mail'] = ['like','%thinkphp@qq.com%']; Db::table('think_user')->where($map)->select(); ~~~ 字符串條件 使用字符串條件直接查詢和操作,例如: ~~~ Db::table('think_user')->where('type=1 AND status=1')->select(); 最后生成的SQL語句是 SELECT * FROM think_user WHERE type=1 AND status=1 ~~~ 使用字符串條件的時候,建議配合預處理機制,確保更加安全,例如: ~~~ Db::table('think_user')->where("id=:id and username=:name")->bind(['id'=>[1,\PDO::PARAM_INT],'name'=>'thinkphp'])->select(); ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看