2wasted Posted June 13, 2006 Share Posted June 13, 2006 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?cheersCharlie Quote Link to comment https://forums.phpfreaks.com/topic/11916-query-then-adding/ Share on other sites More sharing options...
joquius Posted June 13, 2006 Share Posted June 13, 2006 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 resultexample:SELECT AVG (`rating`) FROM `table` Quote Link to comment https://forums.phpfreaks.com/topic/11916-query-then-adding/#findComment-45210 Share on other sites More sharing options...
2wasted Posted June 13, 2006 Author Share Posted June 13, 2006 thx m8 i'll give that a go:-)cyaCharlie Quote Link to comment https://forums.phpfreaks.com/topic/11916-query-then-adding/#findComment-45225 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.