title: Yii how to retrieve a row, delete and insert a new row in another table
body: <p>How do you retrieve a row, delete and insert a new row in another table with Yii framework? Below is what I have so far...</p>
  
  <pre><code>$users=Entrepreneur_temp::model()-&gt;find('email=?', array($email));
              $model-&gt;setAttributes($users);
  
              if(isset($users)){
  
              $model=new Entrepreneur;
              $model-&gt;attributes = $users;
  
              if($model-&gt;save()){
              echo "true";
              }else{
                  echo "error a";
              }
  
              }else{
                  echo "error";
              }
  </code></pre>