|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by Widescope in Microsoft Word, PHP Scripting Language, PHP and Databases
Hello,
I have created a simple poll with 2 options (Yes and No).
Once the poll has been submitted it directs to a page showing the results, I have the total amounts for Yes and No displaying, but I need to show the results as a % of the total votes.
Currently displays
Yes = 3 votes
No = 1 votes
I need it to display
Yes = 75%
No = 25
The recordset's I am currently using, are in the below format.
SELECT answer,COUNT(answer) As Total
FROM poll
WHERE poll.answer = 'Yes'
GROUP BY (answer)
Can anyone help. Thanks.
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625