• 清空数据库中所有表--连表删除


    public function trun(){
      $sql = "show tables";
      $info = M()->query($sql);
      // echo '<meta http-equiv="Content-type" content="text/html:charset=utf-8">';
      // echo '<pre>';
      // var_dump($info);

    foreach($info as $k=>$v){

        $sql = "truncate table ".$v['tables_in_tripb'];
        $num = M()->execute($sql);
        var_dump($num);

    }

    }

    =========连表删除

    delete t_apply

    from t_apply , t_applyitems

    where t_apply.apply_applicant_id = t_applyitems.applyitem_applyid

    and t_apply.apply_applicant_id = 363;

  • 相关阅读:
    每日总结
    每日总结
    《构建之法》读后感3
    每日博客
    每日博客
    每日博客
    每日博客
    预开发软件书
    每日博客
    每日博客
  • 原文地址:https://www.cnblogs.com/bj-tony/p/5662612.html
Copyright © 2020-2023  润新知