单击按钮时,我想将所有数据从我的 table 移动到另一个 table

i want to move all the data from my table to another table when button is clicked

我已经编写了以下代码来将数据插入到 table,我想添加其他按钮,如果我单击该按钮,它将存储我插入到此 [=] 中的所有数据17=] 变成另一个 table.

public function actionInsert()

{


     $nik = Yii::app()->session['nik'];
     $name= yii::app()->session['name'];
     $db = Yii::app()->db;


     $description = $_POST['description'] ;
     $amount= $_POST['amount'] ;
     $project = $_POST['project'];
     $status = "Not Approved";



       $query = "INSERT INTO pengajuan VALUES 
      ('NULL',NOW(),'$nik','$name','$description','$amount',
      'NULL','$project','$status','NULL')";
        $db->createCommand($query)->execute(); 

    $this->redirect(array(
            "pengajuan/index"
    ));
}

问题是我不知道如何解决这个问题,我的意思是我很困惑,我正在考虑使用触发器,但我真的不知道如何

INSERT INTO TABLE2 SELECT * FROM TABLE1

参考:https://www.databasejournal.com/features/mssql/article.php/3507171/Transferring-Data-from-One-Table-to-Another.htm