Jump to content

Archived

This topic is now archived and is closed to further replies.

2wasted

query then adding...

Recommended Posts

can i query the mysql DB and add them for display?i have a guestbook i put a vote on so when i goto the table it says name,email,comment,then there are 2 rows for the vote 'yesvote' and 'novote' with a 1 where there vote is.could i echo out the total added together?
cheers
Charlie

Share this post


Link to post
Share on other sites
you would probably be better having one such field, 1 for yes 0 for no and then getting the average number and multipying it by 100 to get a % style approval result

example:

SELECT AVG (`rating`) FROM `table`

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.