for a php web service i came across a situation for calculating percentage for a question having min 2 and max 5 multiple choice so i am trying like this
I am using below condition
$x=0;
$y=5;
if($x < $row[0] < $y)
row[0] is for getting value from query
I tried but its not working properly is there any other method to calculate. I also tried like
select (count(showdown_choice_id)*100/(select count(showdown_id) from showdown_response where showdown_id='$showid')) from showdown_response where showdown_choice_id='$row[0]' and showdown_id=".$showid
but in while loop(containing values 1 to 5) same percentage is repeated for every choice.
please help me
Try