2017-05-25 42 views

回答

0

嘗試創建命令exceute

Yii::$app->db->createCommand('INSERT INTO posts(name) VALUES(:name)') 
      ->bindParam(':name' => 'John')->execute(); 
+0

$ SQL =的Yii :: $ APP-> DB-> createCommand( 「INSERT INTO職位(名稱)VALUES(:名稱)」); $ sql-> bindValues([':name'=>'John']); $ sql-> execute(); –