| Index
» Projekty
» phpMyEdit
» Fórum
» Join 2 table should be simple and basic, why its so dificult |
 |
yazidmardiko
Založený: 14.07.2011
Príspevky: 0
Zaslal: 2011-07-14 22:02
Návrat hore
Odpovedať s citátom
|
Join table and filter should be basic and simple coding (like query in sql). But why, its becomes very difficult in PME....
Try so many example from forum and web...
SQL working script:
select * from ts_project_team, employee where prm_emp = emp_id and emp_id = 2;
This simple join 2 table not working in PME, shows nothing in browser. And no filtering yet (not used emp_id = 2)
Use PME 5.7.1
$main_table = 'ts_project_team'; // alias of the main table
$join_table = 'ts_employee'; // alias of the values table
$join_column = 'emp_id'; // join column in the values table
$join_description = 'emp_name'; // description column in the values table
$main_column = 'prm_emp'; // join column in the main table
$opts['fdd']['prm_emp'] = array(
'name' => 'Team',
'options' => 'ACPVDFL',
'select' => 'T',
'sqlw' => 'TRIM("$val_as")',
'maxlen' => 11,
'default' => '0',
'sort' => true,
'values' => array(
'join' => '$main_table.$main_column = $join_table.$join_column',
'table' => 'ts_employee',
'column' => 'emp_id',
'description' => array(
'columns' => array($join_description)
)
);
Need working example, with real script... (many type working script of join table)
Almost gaveup with PME, just for simple joining 2 table.. Start considering MATE
|
doug
Založený: 10.02.2003
Príspevky: 1013
Bydlisko: Denver, Colorado (USA)
Zaslal: 2011-07-15 22:21
Návrat hore
Odpovedať s citátom
|
The following all work for me:
http://www.php-form-generator.com/phpmyedit/cheat-sheet/join.txt
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|