| Index
» Projekty
» phpMyEdit
» Fórum
» How to make a third join or subquery |
 |
Malino
Založený: 23.02.2010
Príspevky: 7
Zaslal: 2010-02-23 23:48
Návrat hore
Odpovedať s citátom
|
Hello Community,
I have 3 tables:
| Kód: |
table_a (main table):
---------------------
ta_id
ta_tbid
ta_value1
ta_value2
...
table_b:
--------
tb_id
tb_tcid
tb_value1
...
table_c:
--------
tc_id
tc_value
|
i just want to use phpMyEdit for table_a:
| Kód: |
$opts['fdd']['ta_id'] = array(
'name' => 'Index',
'select' => 'T',
'options' => 'AVCPDR', // auto increment
'maxlen' => 10,
'default' => '0',
'sort' => true
);
$opts['fdd']['ta_tbid'] = array(
'name' => 'Value of table 3',
'select' => 'T',
'maxlen' => 11,
'sort' => true,
'values' => array(
'table' => 'table_b',
'column' => 'ta_id',
'description' => array(
'columns' => array('tb_tcid','tb_value1'),
'divs' => ' ',
)
));
|
and now my problem:
i don't want to show tb_tcid, i want to show tc_value!
Is there any chance to make another join or join on a sql-statement?
Something like that:
| Kód: |
SELECT ta_id, tc_value
FROM table_a
JOIN table_b ON ta_tbid = tb_id
JOIN table_c ON tb_tcid = tc_id
|
or:
| Kód: |
SELECT ta_id, tc_value
FROM table_a
JOIN (table_b JOIN table_c ON tb_tcid = tc_id) ON ta_tbid = tb_id
|
thx Malino
|
paddywwoof
Založený: 25.02.2010
Príspevky: 7
Zaslal: 2010-03-03 10:59
Návrat hore
Odpovedať s citátom
|
have you looked through this? You will have to modify the class definition but it works as far as I can tell.
http://opensource.platon.sk/forum/projects/viewtopic.php?t=103
|
Malino
Založený: 23.02.2010
Príspevky: 7
Zaslal: 2010-03-03 12:08
Návrat hore
Odpovedať s citátom
|
thank you
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|