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 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` 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 Link to comment https://forums.phpfreaks.com/topic/11916-query-then-adding/#findComment-45225 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.