Yii Framework Forum: [Solved] Cdbexception - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[Solved] Cdbexception The table "customer_registration" for active record class Rate Topic: -----

#1 User is offline   Mayur Ahir 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 08-July 11

Posted 04 December 2012 - 08:00 AM

I am getting this error,

Attached File  yii_error.png (293.37K)
Number of downloads: 3

Here is code from Users model
class Users extends CActiveRecord {

    /**
     * Returns the static model of the specified AR class.
     * @param string $className active record class name.
     * @return Users the static model class
     */
    public static function model($className = __CLASS__) {
        return parent::model($className);
    }

    /**
     * @return database associated with this model
     * Caution: User only in-case DB is different from primary source
     */
    public function getDbConnection() {
        /* Secondary DB  */
        return Yii::app()->paytm;
    }

    /**
     * @return string the associated database table name
     */
    public function tableName() {
        return 'customer_registration';
    }

    public function primaryKey() {
        return 'customer_registrationID';
    }


In my config/main.php file
.
.
'components' => array(
        . 
        .
        'db' => array(
            'connectionString' => 'mysql:host=localhost;dbname=sso',
            'emulatePrepare' => true,
            'username' => 'root',
            'password' => 'root',
            'charset' => 'utf8',
            'enableProfiling' => true,
            'enableParamLogging' => true,
        ),
        'paytm' => array(
            'class' => 'CDbConnection',
            'connectionString' => 'mysql:host=localhost;dbname=paytm',
            'emulatePrepare' => true,
            'username' => 'root',
            'password' => 'root',
            'charset' => 'utf8',
            'enableProfiling' => true,
            'enableParamLogging' => true,
        ),
.
.

0

#2 User is offline   Keith 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,520
  • Joined: 04-March 10
  • Location:UK

Posted 04 December 2012 - 08:10 AM

Does the table definitely exist? Can you post your database schema?
0

#3 User is offline   Mayur Ahir 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 08-July 11

Posted 04 December 2012 - 08:27 AM

View PostKeith, on 04 December 2012 - 08:10 AM, said:

Does the table definitely exist? Can you post your database schema?


Yes this table does exists.

Attached File  db.png (5.84K)
Number of downloads: 2
0

#4 User is offline   Keith 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,520
  • Joined: 04-March 10
  • Location:UK

Posted 04 December 2012 - 08:29 AM

The table isn't shown in that image...
0

#5 User is offline   Mayur Ahir 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 08-July 11

Posted 04 December 2012 - 09:06 AM

Ok,

Got it working. Problem was MySQL temp storage path was full so unable to retrive the table structure.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users