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

phpMyEdit General     Can someone post a join of two tables with a sample page?
Odoslať novú tému   Odpovedať na tému    
 
ronbob     Založený: 30.07.2004   Príspevky: 2  
Príspevok Zaslal: 2004-08-01 00:06
Návrat hore  Odpovedať s citátom     

I'm having problems with the join of two tables. i'm trying to have in table one fields from table two...
can someone explain in a simple way the logic of how to do this with a sample page of such code as i'm getting nowhere on my own.
thanks

 
kimo     Založený: 28.07.2004   Príspevky: 2  
Príspevok Zaslal: 2004-08-04 05:46
Návrat hore  Odpovedať s citátom     

hello

i am new too to the matter but i found a extremely easy way to do this (like you i have been searching for sometime)

lets say u have 2 tables and you want to show or edit values from both tables.

TableA
A_ID
A_FD1
A_FD2
B_ID
A_FD3

TableB
B_ID
B_FD1
B_FD2
B_FD3

TableA is connected to TableB via B_ID

you do this

$opts['fdd']['A_FD1'] = array(
'name' => 'TableA_FD1',
'select' => 'T',
'maxlen' => 20,
'sort' => true
);

$opts['fdd']['A_FD2'] = array(
'name' => 'TableA_FD2',
'select' => 'T',
'maxlen' => 20,
'sort' => true
);

$opts['fdd']['B_ID'] = array(
'name' => 'TableA_B_ID', // TableA.B_ID ref
'select' => 'T',
'maxlen' => 20,
'sort' => true
);


$opts['fdd']['B_ID']['values']['table'] = 'TableB';
$opts['fdd']['TechTypeID']['values']['column'] = 'B_ID';
$opts['fdd']['TechTypeID']['values']['description'] = 'B_FD1';

$opts['fdd']['B_ID'] = array(
'name' => 'TableA_B_ID', // TableA.B_ID ref
'select' => 'D',
'maxlen' => 20,
'sort' => true
);


$opts['fdd']['B_ID']['values']['table'] = 'TableB';
$opts['fdd']['TechTypeID']['values']['column'] = 'B_ID';
$opts['fdd']['TechTypeID']['values']['description'] = 'B_FD2';


AND SO ON... you can call as many fields from tableB as you want ... either in Text Boxes or DropDown

if you have a Ref for TableC in TableA like C_ID you could also call other values from TableC if you like, i just don't know if there is a join limit for conecting tables this way

i will find out soon :)








ronbob Napísal:
I'm having problems with the join of two tables. i'm trying to have in table one fields from table two...
can someone explain in a simple way the logic of how to do this with a sample page of such code as i'm getting nowhere on my own.
thanks
[img][/img]

 
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