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  »  simple table join with primary key by virtual field

phpMyEdit General     simple table join with primary key by virtual field
Odoslať novú tému   Odpovedať na tému    
 
themanthing     Založený: 24.12.2009   Príspevky: 5  
Príspevok Zaslal: 2010-04-07 13:01
Návrat hore  Odpovedať s citátom     

Hi all, i can describe the working solution, how it makes to join tables by primary key. Sorry for bad english)

We have: 2 tables,

"main" :
| main_id | gi_sname | city |
-------------------------
| 1 | blab | t1 |

"main_en" :
| main_id | gi_sname |
-------------------------
| 1 | trututu |

We want to show result table, join by main_id (primary key) :
| blab | trututu | t1 |

We can join it simple by adding virtual field:
Kód:

$opts['fdd']['main_id'] = array(
  'name'     => 'Main ID',
  'select'   => 'T',
  'options'  => 'AVCPDR', // auto increment
  'maxlen'   => 10,
  'default'  => '0',
  'sort'     => true
);
$opts['fdd']['gi_sname'] = array(
  'name'     => 'Name',
  'select'   => 'T',
  'size' => 150,
  'size|F' => 80,
  'maxlen'   => 255,
  'sort'     => true
);
$opts['fdd']['virt'] = array(
  'name'     => 'English Name',
  'select'   => 'T',
  'input'   => 'V', // virtual
  'options'  => 'L', // list only
  'size|F' => 50,
  'values'   => Array('table' => 'main_en', 'column' => 'main_id', 'description' => 'gi_sname','join' => '$main_table.main_id = $join_table.main_id'),
  'sql'      => 'PMEjoin2.gi_sname',
  'sort'     => true
);


We don`t need to modify 'main_id' field and we can successfully edit all fields! (in other solutions we can`t do this)

 
gargola     Založený: 22.04.2010   Príspevky: 1  
Príspevok Zaslal: 2010-04-22 19:46
Návrat hore  Odpovedať s citátom     

Hi,

I have multiple tables with data I would like to modify in 1 page.
I read your example, but my data is not linked through a persistent ID:

For example (simple)

Table|Key|Field1|Field2|Field3

Member|MemberID|FirstName|LastName|Place
Branch|BranchID|Location
MemberBranch|MemberID|BranchID

What I want to do, is to be able to edit the Branch of a Member in the same mask in which I edit the member as such.

Kind regards,
gargola

 
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