Reputation: 347
i have my table
accounts (
id int(10)
username
password
)
and members table
members (
id
account_id
first_name
last_name
e_mail
address
book_count
)
i have to show both of the tables in one view with INNER join, how it can be possible?
Upvotes: 0
Views: 1221
Reputation: 46
Read HasOne Associations will solve your problem.
You should follow Cake tutorial to know more about cakephp
If you don't use associations you can do normally with join function
$accounts->join([
'table' => 'members',
'alias' => 'mem',
'type' => 'INNER', //LEFT, RIGHT...
'conditions' => 'mem.account_id = accounts.id',
])->...
Upvotes: 1