Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, November 11, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  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?
Post new topic   Reply to topic    
 
ronbob     Joined: 30 Jul 2004   Posts: 2  
Post Posted: 2004-08-01 00:06
Back to top  Reply with quote     

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     Joined: 28 Jul 2004   Posts: 2  
Post Posted: 2004-08-04 05:46
Back to top  Reply with quote     

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 wrote:
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]

 
Post new topic   Reply to topic    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy