如何计算数组中的文本?

在我的MySQL表(用户数据)中,有一列名为“选项”。完成测验后,用户响应将存储在该列中。 与用户有关的样本数据如下:

{"correctness":{"question_id_209":false,"question_id_208":true,"question_id_207":true,"question_id_206":false,"question_id_205":true},"user_answered":{"question_id_209":"830","question_id_208":"826","question_id_207":"822","question_id_206":"818","question_id_205":"815"},"passed_time":"13 seconds","user_points":3,"max_points":5,"attributes_information":[],"calc_method":"by_correctness"}

现在,我想在该数组中搜索单词“ true”,并希望对该单词进行计数。 我从这里开始,但是不知道下一步该怎么做:

 $query="SELECT options FROM userdata WHERE user_id=1";
 $result= mysqli_query($conn,$query);


评论