yii2: delete values in two tables using single controller action?
<p>I have two tables table1 and table2 and I am trying to delete row in these two table.I have same values on both table but id is different so i tried like this, 
my controller,</p>

<pre><code> public function actionDelete($id)
 {
 $this-&gt;findModel($id);
 $select = Employee::find()
            -&gt;select('Name')
            -&gt;where(['Id' =&gt; $id])
            -&gt;all();
$deluser=Employee::find()-&gt;where(['Id' =&gt; $id])-&gt;one()-&gt;delete() AND User::find()-&gt;where(['Name' =&gt;$select])-&gt;one();
$deluser-&gt;delete();
 return $this-&gt;redirect(['index','select'=&gt;$select]);
}  
</code></pre>

<p>pls anyone help me
Thanks in advance</p>