Reputation: 11
Suppose a table name of mysql database is 'admin
' and controller name is 'userscontroller
' and model name is 'user
'.
How can I access the data from the table 'admin
' in cakephp?
Please explain with code.
Upvotes: 0
Views: 765
Reputation: 478
This is probably not the best solution but What I would do is make a new Model called 'Admin' specifically for that table, then in the UserController Call it, example:
In the UserController
$this->loadModel('Admin');
$this->Admin->find('all');
In the Admin Model
$useTable = 'admin';
Upvotes: 2