Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Sunday, October 18, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  help!, join database update problem.

phpMyEdit General     help!, join database update problem.
Post new topic   Reply to topic    
 
xray     Joined: 06 Oct 2010   Posts: 2  
Post Posted: 2010-10-07 09:40
Back to top  Reply with quote     

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 :

Code:
$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
Code:



Last edited by xray on 2010-10-14 10:03, edited 3 times in total

 
xray     Joined: 06 Oct 2010   Posts: 2  
Post Posted: 2010-10-08 08:24
Back to top  Reply with quote     

Hello,

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

update.php:
Code:
$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

 
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