I'm developing a website and I need to store some question. I've a json like:
[{"id":"1","resp":"y"},{"id":"2","resp":"m"},{"id":"3","resp":"m"},{"id":"4","resp":"m"},{"id":"5","resp":"n"}
id = id question, resp = answer
I need to store this information and compare it with other user. What's the best way? Store one single json for user o create a database like
idquestion1 idquestion2 idquestion3 idquestion4
user yes no yes boh
Now I use Php+mysql
This would be the best table design imho:
user_id | question_id | answer