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 goal that isn't mentioned in the docs

phpMyEdit General     simple goal that isn't mentioned in the docs
Odoslať novú tému   Odpovedať na tému    
 
hlslaughter     Založený: 02.07.2003   Príspevky: 12   Bydlisko: San Diego, CA
Príspevok Zaslal: 2004-05-12 22:17
Návrat hore  Odpovedať s citátom     

this is simple enough, but i don't believe it's mentioned in the docs.

i have two fields in one of my templates:

$opts['fdd']['count_reserve'] = array(
'name' => 'Reserve',
'select' => 'T',
'maxlen' => 11,
'sort' => true
);

$opts['fdd']['count_allocated'] = array(
'name' => 'Allocated',
'select' => 'T',
'maxlen' => 11,
'sort' => true
);

I simply want to have a third field that is the sum of these two fields. the only guess i could come up with was something like this:

$opts['fdd']['count_total'] = array(
'sql' => (count_allocated + count_reserve),
'name' => 'Allocated',
'select' => 'T',
'maxlen' => 11,
'sort' => true
);

but 'count_total' is not actually in the DB table, so this fails.

is there some way i can add up the first two fields and create a third virtual field?

tks

harry

 
ajh     Založený: 17.12.2003   Príspevky: 236  
Príspevok Zaslal: 2004-05-13 13:35
Návrat hore  Odpovedať s citátom     

In the CVS version of PME you can set a field as being a virtual field so it doesn't need to be in the database. Have a look at the documentation in the CVS for the full options.

Then you can do exactly what you need to do.

 
BrentNJ     Založený: 03.06.2004   Príspevky: 12  
Príspevok Zaslal: 2004-06-13 19:37
Návrat hore  Odpovedať s citátom     

I can't find the proper section in the CVS docs for virtual fields.

What filename do I need to read?

Thanks!!

 
hlslaughter     Založený: 02.07.2003   Príspevky: 12   Bydlisko: San Diego, CA
Príspevok Zaslal: 2004-07-17 01:28
Návrat hore  Odpovedať s citátom     

my biggest problem was that i wasn't using the latest version of PME. i used it before and it seemed to have some new problems that i wasn't ready to deal with. but when i do use the latest version, this gives me the result i was looking for

Kód:

$opts['fdd']['count_total'] = array(
  'name'     => 'Total',
  'select'   => 'T',
  'maxlen'   => 11,
  'sql'      => 'field1 + field2',
  'sort'     => true
);


 
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