Hello,
I am very new to yii framework and I am having issue is creating model.
My php version is,
$~[ PHP ]protected$php -v
PHP 5.2.0-8+etch13 (cli) (built: Oct 2 2008 08:26:18)
Copyright © 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright © 1998-2006 Zend Technologies
with Xdebug v2.0.3, Copyright (c) 2002-2007, by Derick Rethans
I have created an application, using webapp.
I have configured the database connection as following,
$~[ PHP ]protected$less config/main.php
'db'=>array(
'class'=>'CDbConnection',
'connectionString' => 'pgsql:host=<ip-address>;dbname=<db-name>',
'username' => '<user-name>',
'password' => '<password>',
),
After creating my application, to create a model following error is occurred saying table does not exist but the table is present in the specified database in public schema,
$~[ PHP ]protected$yiic shell config/main.php
/home/user/public_html/YII/yii-1.1.3.r2247/TESTING/protected/config/console.phpYii Interactive Tool v1.1 (based on Yii v1.1.3)
Please type ‘help’ for help. Type ‘exit’ to quit.
>> model Products product
Warning: the table ‘product’ does not exist in the database.
generate models/Products.php
exist fixtures/product.php
...overwrite? [Yes|No|All|Quit] skip fixtures/product.php
generate unit/ProductsTest.php
The following model classes are successfully generated:
Products
If you have a ‘db’ database connection, you can test these models now with:
$model=Products::model()->find();
print_r($model);
>> $model=Products::model()->find();
productexception ‘CDbException’ with message ‘The table “product” for active record class “Products” cannot be found in the database.’ in /home/user/public_html/YII/yii-1.1.3.r2247/framework/db/ar/CActiveRecord.php:2052
Stack trace:
…
Pleas help me overcome this issue.
Thanks in advance.
Regards,
Selvi