0
我想使用但不工作,請幫助我。Yii2插入查詢與bindparam爲sql注入
$sql = Yii::$app->db("INSERT INTO posts(name) VALUES(:name)");
$sql->bindValues([':name' => 'John']);
$sql->execute();
我想使用但不工作,請幫助我。Yii2插入查詢與bindparam爲sql注入
$sql = Yii::$app->db("INSERT INTO posts(name) VALUES(:name)");
$sql->bindValues([':name' => 'John']);
$sql->execute();
嘗試創建命令exceute
Yii::$app->db->createCommand('INSERT INTO posts(name) VALUES(:name)')
->bindParam(':name' => 'John')->execute();
$ SQL =的Yii :: $ APP-> DB-> createCommand( 「INSERT INTO職位(名稱)VALUES(:名稱)」); $ sql-> bindValues([':name'=>'John']); $ sql-> execute(); –