| Index
» Projects
» phpMyEdit
» Forum
» Join 2 table should be simple and basic, why its so dificult |
 |
yazidmardiko
Joined: 14 Jul 2011
Posts: 0
Posted: 2011-07-14 22:02
Back to top
Reply with quote
|
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
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2011-07-15 22:21
Back to top
Reply with quote
|
The following all work for me:
http://www.php-form-generator.com/phpmyedit/cheat-sheet/join.txt
|
|
Post new topic
Reply to topic
|
|
|
|