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  »  help!, join database update problem.

phpMyEdit General     help!, join database update problem.
Odoslať novú tému   Odpovedať na tému    
 
xray     Založený: 06.10.2010   Príspevky: 2  
Príspevok Zaslal: 2010-10-07 09:40
Návrat hore  Odpovedať s citátom     

Hello community,

I have a working join in List mode, but i don't know how to save the data in to the columns. I try to learn phpmyedit and found a working code somewhere on this board.
Documentation is clear about creating a join, but i can't find any solution how to save the data? Maybe i misunderstood the working of a join, i am a absolute beginner :)

My question is: how to save data created with this join?

The code hereunder, i found :

Kód:
$main_table = 'invoice';
$join_table = 'supplier';

$opts['fdd']['supplier_id'] = array(
  'name'     => 'Supplier ID',
  'select'   => 'D',
  'options'  => 'VACPDL',
  'maxlen'   => 11,
  'sort'     => true,
  'values' => Array(
         'table'       => $join_table,
         'column'      => 'supplier_id',
         'description' => 'supplier_id',
         'join' => '$main_table.supplier_id = $join_table.supplier_id',
   )
);

$opts['fdd']['supplier_id1'] = array(
    'name' => 'Supplier Name',
    'options'    => 'L',
    'sort' => true,
    'values' => Array(
         'table'       => $join_table,
         'column'      => 'supplier_id',
         'description' => 'supplier_name',
         'join' => '$main_table.supplier_id = $join_table.supplier_id',
    ),
);

$opts['fdd']['supplier_id2'] = array(
    'name' => 'Address',
    'options'    => 'L',
    'sort' => true,
    'values' => Array(
         'table'       => $join_table,
         'column'      => 'supplier_id',
         'description' => 'supplier_address',
         'join' => '$main_table.supplier_id = $join_table.supplier_id',
    ),
);

$opts['fdd']['supplier_id3'] = array(
    'name' => 'Phone',
    'options'    => 'L',
    'sort' => true,
    'values' => Array(
         'table'       => $join_table,
         'column'      => 'supplier_id',
         'description' => 'supplier_phone',
         'join' => '$main_table.supplier_id = $join_table.supplier_id',
         ),
);


Thanks,
Raymond
Kód:



Naposledy upravil xray dňa 2010-10-14 10:03, celkom upravené 3 krát

 
xray     Založený: 06.10.2010   Príspevky: 2  
Príspevok Zaslal: 2010-10-08 08:24
Návrat hore  Odpovedať s citátom     

Hello,

I tried unsuccessfully sql or sqlw. The codes below works partially:
Kód:
$opts['triggers']['insert']['after']  = 'update.php';
$opts['triggers']['update']['after']  = 'update.php';

update.php:
Kód:
$this->myquery("
    UPDATE invoice
    SET
    supplier_id1 =\"".$newvals['supplier_id1']."\",
    supplier_id2 =\"".$newvals['supplier_id2']."\",
    supplier_id3 =\"".$newvals['supplier_id3']."\"
    WHERE invoice_id =\"".$this->rec."\"
    ");
return(false);

The working part is; selecting the right record :)

Pleas a hint or a push to the right direction is very much appreciated.

Greetings,
Raymond

 
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