PrajapatiRaj / yii-user

Automatically exported from code.google.com/p/yii-user
0 stars 0 forks source link

tableName() functions for some models return table names that cannot be found in the database #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Import database schema.mysql.sql
2. Goto Registration page (/yourapp/user/registration)

What is the expected output? What do you see instead?
I expect to see the registration page.  Instead, I get this error:

The table "{{users}}" for active record class "RegistrationForm" cannot be
found in the database.

What version of the product are you using? On what operating system?
I am using Yii 1.1.0 with a MySQL database.

Please provide any additional information below.
I was able to correct the issue by changing "{{users}}" to "tbl_users"
The same issue occurs for other models as well, including the Profile and
ProfileField models.

Original issue reported on code.google.com by wanderin...@gmail.com on 27 Feb 2010 at 4:08

GoogleCodeExporter commented 8 years ago
http://code.google.com/p/yii-user/issues/detail?
id=6&can=1&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Summary%2
0Reporter#c1

Original comment by mish...@gmail.com on 4 Mar 2010 at 4:50

GoogleCodeExporter commented 8 years ago
im having the same problem

Original comment by Adrian....@gmail.com on 15 Nov 2010 at 11:19

GoogleCodeExporter commented 8 years ago
Insert 'tablePrefix' => 'tbl_' to db configuration (protected/config/main.php)

'db'=>array(
    ...
    'tablePrefix' => 'tbl_',
),

Original comment by mish...@gmail.com on 16 Nov 2010 at 2:39

GoogleCodeExporter commented 8 years ago
I added

'tablePrefix' => '',

rather than not having tablePrefix in the config array.

I was then able to use table names without a prefix.

Original comment by westway...@gmail.com on 21 Apr 2011 at 6:02