help – foreign key, backjoint between 3 tables
- winman1
- Member | 10
hi guys,
i have table youtube_channel_playlist
with 2 foreign keys to
2 other tables youtube_channel
and
youtube_playlist
:
CONSTRAINT FK_channel_playlist__channel_id
FOREIGN KEY
(channel_id
) REFERENCES youtube_channel
(channel_id
) ON UPDATE CASCADE,
CONSTRAINT FK_channel_playlist__playlist_id
FOREIGN KEY
(playlist_id
) REFERENCES youtube_playlist
(playlist_id
) ON UPDATE CASCADE
when i try fetch all rows from youtube_channel_playlist
with
parameter $dbChannelId:
$rows = $this->database->table(‘youtube_playlist’)
->select(‘youtube_playlist.playlist_id’)
->select(‘youtube_playlist.yt_playlist_id’)
->select(‘youtube_playlist.yt_playlist_title’)
->where(‘:youtube_channel_playlist.youtube_channel.channel_id’,
$dbChannelId)
I allways get such the error:
No reference found for $youtube_channel_playlist->youtube_channel
seems Nette understand “:youtube_channel_playlist” for
relationship youtube_playlist to youtube_channel_playlist
but it does not understand next “.” in
“youtube_channel_playlist.youtube_channel”
Please could you give an advance? Many thanks.