Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Pondelok, 30. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Update fields from multiple tables

phpMyEdit Configuration     Update fields from multiple tables
Odoslať novú tému   Odpovedať na tému    
 
ceaza     Založený: 05.09.2007   Príspevky: 3  
Príspevok Zaslal: 2007-09-05 21:03
Návrat hore  Odpovedať s citátom     

Hi All
I am trying to view and then update the tables.
I would need to add more fields from other tables as well.
This is what I have so far:

Kód:
$opts['filters'] = "PMEtable0.CustomersID =" .$_SESSION['CustomersID']. " AND MainContact='yes'";

$main_table = "Customers";
$join_table = "Contact_person";

$opts['fdd']['CustomersID'] = array(
  'name'     => 'Customer',
  'values'   => Array(
     'table'       => $join_table, //joined table
     'column'      => 'CustomersID', //the joined key
     'description' => 'CustomersID'),
  'join'     => '$main_table.Customers = $join_table.Contact_person',
  'options'  => 'VD',
  'maxlen'   => 1,
  'sort'     => false
);


$opts['fdd']['CustomersID|1'] = array(
  'name'     => 'Account Number',
  'options'  => 'LACPVDR',
  'sql'      => 'PMEtable0.CustomersID',   
  'select'   => 'T',
  'maxlen'   => 11,
  'default'  => '0',
  'sort'     => false
);

  $opts['fdd']['CustomersID|2'] = array(
  'name'     => 'Email',
  'options'  => 'LACPVD',
  'sql'      => 'PMEjoin8.email',   
  'select'   => 'T',
  'maxlen'   => 45,
  'default'  => '0',
  'sort'     => false
);


I am quering the Customers and Contact_person tables and joining on the CustomersID field. For now I just want the email field in the Contact_person.

The above gives me a correct listing with the correct filter.

    Firstname myfirstname
    Surname mysurname
    Company mycompanyname
    Username myusername
    password abcdef
    ID Number xxxxxxxxxxx
    VAT Number xxxxxxx
    Customer 1009.1
    Account Number 1009.1
    Email email@address.com


The edit shows me all the correct fields as well.
but when I click update I get the following error.


You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '|2='email@address.com' WHERE (ID=6)' at line 1


If I comment ['CustomersID|2'] out the Customers table gets updated perfectly.

I have tried and tried and now at a loss.
Please help.

Michael

 
michal     Založený: 17.06.2003   Príspevky: 537   Bydlisko: Slovakia
Príspevok Zaslal: 2007-10-22 12:12
Návrat hore  Odpovedať s citátom     

cvs version was changed recently, which should help to solve this.

 
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