I (newbie) am creating a database to record the answers of an online test. I would like to be able to instantly compute a score by comparing the number of matching answers (ob_1 through ob_5) between a user and a test_key.
I was wondering what the best way would be to go about doing this. Should I convert it into an array and perform a function, or is there a php function that could compare it in the db?
I will eventually have 50+ questions so I'm looking for a way to iterate over each "ob_" to compare answers.
+---------+----------+---------------+------+----------+------+-------+------+
| videoid | uw_id | submit_date | ob_1 | ob_2 | ob_3 | ob_4 | ob_5 |
+---------+----------+---------------+------+----------+------+-------+------+
| 7 | test_key | 0000-00-00 | no | not sure | no | yes | yes |
| 8 | invisibo | 2004-06-10 | no | not sure | no | no | yes |
+---------+----------+---------------+------+----------+------+-------+------+
thanks in advance
-brad