Answer the question
In order to leave comments, you need to log in
How to join same table?
Statement could not be executed (42000 - 1066 - Not unique table/alias: 'media')
$select->join(
DbTables::TBL_MEDIA,
DbTables::TBL_MEDIA . '.id = ' . $this->getTable() . '.media',
[
'logo_path' => 'media_path'
],
Select::JOIN_LEFT
);
$select->join(
DbTables::TBL_MEDIA,
DbTables::TBL_MEDIA . '.id = ' . DbTables::TBL_REL_ANNOUNCEMENT_MEDIA . '.media_id',
[
'announcement_media_path' => 'media_path'
],
Select::JOIN_LEFT
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question