Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, November 11, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  Please help with default calculated field value

phpMyEdit General     Please help with default calculated field value
Post new topic   Reply to topic    
 
dan     Joined: 22 Aug 2007   Posts: 2  
Post Posted: 2007-08-22 17:18
Back to top  Reply with quote     

I am not that good at php and would appreciate any help in here

I have a number of fields and would like to automatically set a field to the sum of 2 other fields (so display but not editable and on save would have the value of the sum of 2 other fields)
Do I need to use triggers?
Here's my simple thinking

Add the following:
calculate the sum
$val (how would I set this to teh sum of 2 fields??)
'sqlw|AC' => $val (is this correct?
then add
$opts['cgi']['overwrite']['Total'] = '$val';

Many thanks for your help

Cheers
Dan

 
michal     Joined: 17 Jun 2003   Posts: 537   Location: Slovakia
Post Posted: 2007-08-31 15:45
Back to top  Reply with quote     

so you have column1 and column2 and you wish to have column3 as column1+column2 ?

just 'sql'=>'column1+column2' should work.

 
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