Working with 2 tables

Hello,
I have 2 tables:

Videos table:

  • id
  • title

Tags table:

  • video_id
  • tag_id

If I selected a row from the videos table, how can I select the equal row in the Tags table? (Where video_id = (my selected row id).

I don’t know how to do it since I have only a video table instance while I work on this table.

Are you unable to use join?

Which version of framework your used?

How can I do it with cakephp?

The most recent version.

Follow the doc https://book.cakephp.org/3.0/en/orm/query-builder.html

You can give association with these two tables you can get full associated table data.

Reffer this link…