Can you sum up table fields with one query?
-
Hi!
I wonder if the following is possible with this plugin:
(I can better use an actual example than a vague question I think)I have a site where people use Contact Form 7 (DB) to answer a few questions, which are stored in the database. Let’s say one of the answers is based on five ‘colors’ from which they can choose, for example. Now, I want to show a (real time) pie chart thats shows all five categories and the percentage of answers. Let’s say there are 10 people with these answers: 5x blue, 2x red and 3x yellow.
Can I show this? There’s one one query possible, so I’m not sure.
I’m using something like this:
select * from wp_database_submits where field_name = "color"
These are the raw query results (actually in random order):
Blue
Blue
Blue
Blue
Blue
Red
Red
Yellow
Yellow
YellowIs there a way to show that 50% picked blue, 20% red and 30% yellow? In a pie chart?
Any help would be greatly appreciated! ??
https://www.ads-software.com/plugins/wp-business-intelligence-lite/
- The topic ‘Can you sum up table fields with one query?’ is closed to new replies.