How to write inner join in cakephp 3.6.7

in core php we are using query like this:

SELECT * FROM users INNER JOIN registration ON users.id=registration.id WHERE users.id='7’

how can write in Cakephp 3.6.7

thanks & regards,
Darshan

Here it is :wink:

anyone write for that above query…?

You should read the doc :nerd_face: you can also do it with the connection manager as well:

    public function customQueryManager()
{
    $c = ConnectionManager::get('default');
    return $c
            ->query(
                "SELECT * FROM users INNER JOIN registration ON users.id=registration.id WHERE users.id=7")
            ->fetchAll('assoc');

}

or by using join with the querybuilder :wink:

i am using like this

$query1 = TableRegistry::get(‘users’)
->find()
->join(
[
‘table’ => ‘registration’,
‘type’ => ‘INNER’,
‘conditions’ => [
‘registration.id’ => ‘users.id’,
‘users.id’ => 1
]
]
);

in that above query using in controller and how to call to design…?

any suggestion…?

in that above code will written in controller right…?

No, you should add it in Model…

Probably you should do tutorial first or read the ORM documentation :wink:

i am not getting…