Skip to main content
Topic: multiply two numeric fields of the same tab (Read 1148 times) previous topic - next topic

multiply two numeric fields of the same tab

hi

i have created one table with 3 field, import, qt, total.
how i can do to multiply (import * qt) in total field when i add record ?

thank you

Re: multiply two numeric fields of the same tab

Reply #1
Hi @Domenico
just add this code on
Add Page properties->> action After Add
change >>TABLE_NAME<< for your table name.

and this should work.

//   total = (import * qt)
$db->rawQuery("update >>TABLE_NAME<< set total = import * qt WHERE >>TABLE_NAME<<.id='$rec_id'");

Re: multiply two numeric fields of the same tab

Reply #2
OK!! thanks. it work,

i added this also edit page, but not work when i change value

 

Re: multiply two numeric fields of the same tab

Reply #3
ok, now work.!!!