title: How do I delete rows in Yii2?
body: <p>I want to delete a row in database based on some condition. I tried like this</p>
  
  <pre><code>$fanclub        =   FanClub::find()-&gt;where(['user_id'=&gt;$userid])-&gt;
              andwhere(['crew_member_id'=&gt;$id])-&gt;one();
              if($fanclub)
              {
                  $fanclub-&gt;delete();
              }
  </code></pre>
  
  <p>is this the right way to delete a row in database?</p>