title: Yii - The table for active record class cannot be found in the database
body: <p>I have created a website using the Yii framework and I get the error " <strong>The table for active record class cannot be found in the database.</strong>". I have confirmed and the table does exist in the database. I have also verified that the table name in the database has the same case as the table name in the model class. </p>
  
  <p>Moreover this error is appearing randomly. Has any one else faced this problem? Thanks for your time.</p>
  
  <p><strong>Update</strong>
  Model Code:</p>
  
  <pre><code>class User extends CWIActiveRecord
  {
  
          public $confirmEmail;
          public $confirmPassword;
          public $currentPassword;
          public $newPassword;
          public $newPasswordRepeat;
          private $_identity; 
  
      public function tableName()
      {
          return "cwi_user";
      }
  
     public static function model($className=__CLASS__)
     {
          return parent::model($className);
     } 
  
     public function attributeLabels()
     {
      return array(
          'id' =&gt; 'ID',
          'email' =&gt; 'Email',
          'password' =&gt; 'Password',
          'isSubscribed' =&gt; 'Receive updates about investment, special offers and updates on '. Yii::app()-&gt;name,
          'verificationToken' =&gt; 'Verification Token',
          'status' =&gt; 'Status',
          'accountType' =&gt; 'Account Type',
          'createdBy' =&gt; 'Created By',
          'lastModifiedBy' =&gt; 'Last Modified By',
          'createdDate' =&gt; 'Created Date',
          'lastModifiedDate' =&gt; 'Last Modified Date',
          'createdIp' =&gt; 'Created Ip',
          'lastModifiedIp' =&gt; 'Last Modified Ip',
          'currentPassword' =&gt; 'Existing Password',
          'newPassword' =&gt; 'New Password',
          'newPasswordRepeat' =&gt; 'Confirm Password',
      );
  }
  
  }
  </code></pre>
  
  <p>Database Config:</p>
  
  <pre><code>'db'=&gt;array(
          'connectionString' =&gt; 'mysql:host=localhost;dbname=test',
          'emulatePrepare' =&gt; true,
          'username' =&gt; 'root',
          'password' =&gt; '',
          'charset' =&gt; 'utf8',
      ),
  </code></pre>