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

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # 更新數據庫 ## 成功返回影響行數 ## 失敗返回0 ![![](https://img.kancloud.cn/cc/60/cc605ab8a62c37c0d77e66151a634e24_451x205.png)](images/screenshot_1639233565428.png) ## 語法: ## $this->save(數據數組,[鍵名稱=>要更改的值]) ## $this->save($data,['id'=>20]) ``` $this->save($data,['id'=>20]); //更新數據庫 ``` ## 代碼案例: ``` <?php namespace app\index\model; use think\Model; class Maik extends Model{ public function usenameinfo(){ $data=['name'=>'guohao','password'=>'12387','age'=>28]; //值 $this->save($data,['id'=>20]); //更新數據庫 } } ``` ## update()方法 ## 語法: ## $this->where('鍵名',‘要修改的條件名稱’)->update(數組值) ``` $res=$this->where('id',2)->update($data); ``` 代碼案例: ``` <?php namespace app\index\model; use think\Model; class Maik extends Model{ public function usenameinfo(){ $data=['name'=>'guohao','password'=>'12387','age'=>28]; //值 $res=$this->where('id',2)->update($data); dump($res); } } ``` ## 批量更新: ## $this->saveAll(數組值); ## 數組值最后設置一個 自增主鍵的數組數值 ## 二維數組里自動判斷自增主鍵 ``` $data=[ ['name'=>'guohao2','password'=>'123873','age'=>28,'id'=>1], ['name'=>'guohao1','password'=>'123874','age'=>28,'id'=>3], ]; // id=1條件 id=3 條件 $res=$this->saveAll($data); dump($res); ```
                  <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>

                              哎呀哎呀视频在线观看