basically my project is about personality test, it content 6 page of question which each page has 13 question
page 1
-----------------------
question 1 checkbox1
question 2 checkbox2
.
.
.
.
.
question 13 checkbox13
-------------------------------
once user click on next page, system will calculate number of checked check box and display the value on result page
and i having a problem to calculate number of checked checkbox in php.
i hope u guys can help me~
below is some of my code to retrieve data from dtbase
Expand|Select|Wrap|Line Numbers
- <?php mysql_select_db("esci", $conn);
- $result = mysql_query("SELECT * FROM personality_rule WHERE conclusion = 'Realistic'");
- while($data = mysql_fetch_array($result))
- {
- $rules = str_replace("_"," ",$data['question']);
- echo'
- <tr>
- <td>'. $rules.'</td>
- <td align="center"><input type="checkbox" name="ans"/></td>
- </tr>
- ';
- }
- ?>