gideonleroux
Joined: 14 Sep 2006
Posts: 7
Posted: 2006-09-14 22:59
Back to top
Reply with quote
|
example
field1 (user editable)
- (minus) field2 (user editable)
= (equals) field3 (this value must be auto generated)
or
field1 (user editable)
+ (plus/sum) field2 (user editable)
= (equals) field3 (this value must be auto generated)
the user can only input data in fields 1 and 2
the question is how do i do basic add/sum or subtract with this tool?
i am a novice whith this stuff please help many thanks
|
michal
Joined: 17 Jun 2003
Posts: 537
Location: Slovakia
Posted: 2006-09-16 22:51
Back to top
Reply with quote
|
create a new $opts['ffd']['dummy_field'] with 'sql' col1+col2 and options VLF (no add and change).
|
gideonleroux
Joined: 14 Sep 2006
Posts: 7
Posted: 2006-09-18 22:19
Back to top
Reply with quote
|
| michal wrote: |
| create a new $opts['ffd']['dummy_field'] with 'sql' col1+col2 and options VLF (no add and change). |
afraid i dont understand your syntax
lets say i have this:
$opts['fdd']['User1'] = array(
'name' => 'User1',
'select' => 'T',
'maxlen' => 11,
'sort' => true
);
$opts['fdd']['User2'] = array(
'name' => 'User2',
'select' => 'T',
'maxlen' => 11,
'sort' => true
);
$opts['fdd']['User3'] = array(
'name' => 'User3',
'select' => 'T',
'maxlen' => 11,
'sort' => true
i want to have the number that is in 'user1' added to the number in 'user2' and dislpayed in 'user3'
|
michal
Joined: 17 Jun 2003
Posts: 537
Location: Slovakia
Posted: 2006-09-19 09:42
Back to top
Reply with quote
|
$opts['fdd']['User3']['sql'] = 'User1+User2';
|
gideonleroux
Joined: 14 Sep 2006
Posts: 7
Posted: 2006-09-19 10:40
Back to top
Reply with quote
|
| michal wrote: |
| $opts['fdd']['User3']['sql'] = 'User1+User2'; |
GREAT IT WORKS! THANKS A MIL!
sorry fot the simple questions but
what is the syntax for subtracting col1 from col2
or dividing, or multiplying, or do you know where i can read more about the syntax?
|
michal
Joined: 17 Jun 2003
Posts: 537
Location: Slovakia
Posted: 2006-09-19 12:10
Back to top
Reply with quote
|
http://dev.mysql.com/doc/refman/4.1/en/functions.html
|
gideonleroux
Joined: 14 Sep 2006
Posts: 7
Posted: 2006-09-19 13:05
Back to top
Reply with quote
|
Thank you!
|
Sherzzo
Joined: 03 Jun 2008
Posts: 2
Posted: 2008-06-03 20:18
Back to top
Reply with quote
|
$opts['fdd']['CostPerSet'] = array(
'name' => 'Cost/Set',
'select' => 'T',
'maxlen' => 21,
'sort' => true
);
$opts['fdd']['Discount'] = array(
'name' => 'Disc.',
'select' => 'T',
'maxlen' => 7,
'sort' => true
);
$opts['fdd']['CostPerSet`+`PMEtable0`.`Discount'] = array(
'name' => 'DiscountTotal',
'select' => 'T',
'maxlen' => 25,
'sort' => true
);
|
Sherzzo
Joined: 03 Jun 2008
Posts: 2
Posted: 2008-06-03 20:27
Back to top
Reply with quote
|
Or try this injection
| Code: |
$opts['fdd']['NumSetsOrdered`*`PMEtable0`.`CostPerSet`-`PMEtable0`.`NumSetsOrdered`*`PMEtable0`.`CostPerSet`*`PMEtable0`.`Discount'] = array(
'name' => 'TotalPOAmount',
'select' => 'T',
'maxlen' => 25,
'sort' => true,
'input' => 'R'
);
|
|
|
Post new topic
Reply to topic
|