Let me say I write items to a database. That works fine!
For example is save to database:
columns: name - cat1 - cat2 - cat3
cat1 cat2 and cat3 are all integers
I want to display the sum of each column to the site.
Can that be done, I found helpitems for this from 2010 but they don't work anymore.
Kind regards
Hi Joeri,
You will need to use a "Read data" action and in the "Field to retrieve" box use:
SUM(cat1):cat1_sum
Then you can extract the result using a shortcode, if your "Select type" is set to "first matching" then you need something like this:
{var:read_data_name.Model_name.cat1_sum}
Best regards
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Hi joeriFranck ,
It's not simple to sum values in the same row using MySQL so probably the best solution is to use a Custom Code or PHP action after you load the data, calculate the total and add it to your form data as a new entry.
Bob
Hi joeriFranck,
The "read_data_name" in your case is "read_data11"
Best regards
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
with <p style="text-align: center;">{var:read_data11.totaalcat1.cat1_sum} --</p>
it doens't work either
I need this now for another form to but have still no clue
It's been more than a month now ?? Somebody?
Hi JoeriFranck,
You said that the column names were cat1, . . . but in one of your images you have SUM(_catagorie1) . . . is that correct? It would be unusual to have a column name starting with an underscore?
Bob
model.field1:field1
model.field2:field2
model.field3:field3
(model.field + model.field2 + model.field3):model.alias