im assuming the following things....
a) that the 'vote' field is used to identify what the user is voting for.
b) that we arent trying to show what user has voted for what, but to show a total vote statistic
c) that your 'answer' field will only ever have two answers in it, yes, or no.
if any of these isnt the case, give us a slap, then tell me what you're intending...
otherwise...
you need to query three times.
$sql = "SELECT * FROM votes WHERE vote = '#'";
and get total rows (we'll call this '$total'). you'll use this for your percentages.
$sql = "SELECT * FROM votes WHERE vote = '#' AND answer = 'yes'"
and get total rows (we'll call this '$yes'). you now have how many 'yes' answers there are
$sql = "SELECT * FROM votes WHERE vote = '#' AND answer = 'no'"
and get total rows (we'll call this '$no'). you now have how many 'no' answers there are
right, now.
easy peasy.
print "Yes $yes vote(s) (".(($yes/ $total)*100)."%). No = $no vote(s) (".(($no / $total)*100)."%)