Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Streda, 25. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  join tables with phpmyedit

phpMyEdit General     join tables with phpmyedit
Odoslať novú tému   Odpovedať na tému    
 
skeut     Založený: 18.03.2011   Príspevky: 1  
Príspevok Zaslal: 2011-03-18 15:02
Návrat hore  Odpovedať s citátom     

hi,

I have to join 2 tables but I don't know how to. Here my 3 tables:
groups
usergroup
users

The table structure is as follows:
groups:
+-----------+
| groupname |
+-----------+
| gr1 |
| gr2 |
+-----------+
usergroup:
+---------------+-----------+
| username | groupname |
+---------------+-----------+
| user1 | gr1 |
| user1 | gr1 |
| user2 | gr1 |
| user3 | gr2 |
+---------------------------+
users:
+---------------+---------------+
| username | passwd |
+---------------+---------------+
| user1 | xxxxxxxx |
| user2 | xxxxxxxx |
| user3 | xxxxxxxx |
+-------------------------------+

The objective is to manage the table 'users' and the table 'groups'. Table groups, no problem.

But for the table 'users', I would like to display on each user the group to which it belongs. By adding or update a user, also have a multiple choice list (containing the groups). Is it possible to join the users and usergroup?

I cann't do this, thank you for your help
skeut

 
yazidmardiko     Založený: 14.07.2011   Príspevky: 0  
Príspevok Zaslal: 2011-07-14 21:48
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... this simple join 2 table not working.
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 MySQLAjaxTableEditor

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov