select id from table using like in 2nd table both related by a 3rd table

by wbdevlop   Last Updated September 10, 2019 05:10 AM

I have 3 table and I want to select t1_id from table_1 where table_2.en_name = $name;

table_1              table_2              table_3
t1_id    fr_name     t2_id    en_name     t1_id    t2_id
1        Alpha       5        aaaaaa      1        9
2        beta        6        bbbbbb      2        5
3        gama        9        cccccc      3        6
4        delta       11       dddddd      4        11

I tried with this code but I didn't succeed

    'SELECT '.$ucmTable->special->dbtable.'.id FROM '.$ucmTable->special->dbtable.' 
LEFT JOIN #__content_item a ON a.ref_id='.$ucmTable->special->dbtable.'.id
INNER JOIN jos_falang_content AS en_table ON en_table.reference_id = a.ref_id 
WHERE en_table.reference_field = "content_item_ad" AND en_table.value LIKE "%"'.$en_word.'"%"';
Tags : joomla-3.x php


Related Questions