0

I am not able to create a model in yii model genrator.(Xamp on windows) I am following the steps from http://www.yiiframework.com/forum/index.php/topic/32415-create-login-form/

I made change(s) in config/main.php file... paste the db name there "as test". I created a user table in my database "test". while using gii ..it is not creating model and showing me error

Error Table 'user' does not exist.

I do not know what i am missing .

here is my config/main.php file view

    'modules'=>array(
    // uncomment the following to enable the Gii tool

    'gii'=>array(
        'class'=>'system.gii.GiiModule',
        'password'=>'gii',
        // If removed, Gii defaults to localhost only. Edit carefully to taste.
        'ipFilters'=>array('127.0.0.1','::1'),
    ),

), 
  /*
    'db'=>array(
        'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/test.db',
    ),*/
    // uncomment the following to use a MySQL database

    'db'=>array(
        'connectionString' => 'mysql:host=localhost;dbname=test',
        'emulatePrepare' => true,
        'username' => 'root',
        'password' => '',
        'charset' => 'utf8',
    ),
  • have you checked your database whether it contains any user table or not ? – Let me see Aug 27 '14 at 11:57
  • When you try to create model using table name 'user',is it showing suggestion on model generation page of table name text box? If not showing your table name when u try to model generate, then your test database doesn't contains user table – A l w a y s S u n n y Aug 31 '14 at 06:44

0 Answers0