我有一个存储提供的科目的表格和一个存储学生在考试中得分的结果的表格,在使用视图表显示结果时,我希望系统显示一个 (-) 学生不参加该科目和他正在学习的主题的分数。
存储的主题的样本数组是:
Array (
[0] => stdClass Object ( [subCode] => 101 [subName] => English )
[1] => stdClass Object ( [subCode] => 102 [subName] => Kiswahili )
[2] => stdClass Object ( [subCode] => 121 [subName] => Mathematics )
[3] => stdClass Object ( [subCode] => 231 [subName] => Biology )
[4] => stdClass Object ( [subCode] => 232 [subName] => Physics )
[5] => stdClass Object ( [subCode] => 233 [subName] => Chemistry )
[6] => stdClass Object ( [subCode] => 311 [subName] => History )
[7] => stdClass Object ( [subCode] => 312 [subName] => Geography )
[8] => stdClass Object ( [subCode] => 313 [subName] => CRE )
[9] => stdClass Object ( [subCode] => 443 [subName] => Agriculture )
[10] => stdClass Object ( [subCode] => 565 [subName] => Business Studies ) )
包含要显示的学生结果的数组是:
Array ( [0] => stdClass Object ( [admNo] => 2129 [subCode] => 101 [score] => 78 ) [1] => stdClass Object ( [admNo] => 2129 [subCode] => 102 [score] => 80 ) [2] => stdClass Object ( [admNo] => 2129 [subCode] => 121 [score] => 70 ) [3] => stdClass Object ( [admNo] => 2129 [subCode] => 231 [score] => 76 ) [4] => stdClass Object ( [admNo] => 2129 [subCode] => 233 [score] => 76 ) [5] => stdClass Object ( [admNo] => 2129 [subCode] => 311 [score] => 85 ) [6] => stdClass Object ( [admNo] => 2129 [subCode] => 313 [score] => 90 ) [7] => stdClass Object ( [admNo] => 2129 [subCode] => 565 [score] => 80 ) [8] => stdClass Object ( [admNo] => 4093 [subCode] => 101 [score] => 60 ) [9] => stdClass Object ( [admNo] => 4093 [subCode] => 102 [score] => 70 ) [10] => stdClass Object ( [admNo] => 4093 [subCode] => 121 [score] => 85 ) [11] => stdClass Object ( [admNo] => 4093 [subCode] => 231 [score] => 80 ) [12] => stdClass Object ( [admNo] => 4093 [subCode] => 232 [score] => 80 ) [13] => stdClass Object ( [admNo] => 4093 [subCode] => 233 [score] => 80 ) [14] => stdClass Object ( [admNo] => 4093 [subCode] => 312 [score] => 95 ) [15] => stdClass Object ( [admNo] => 4093 [subCode] => 565 [score] => 86 ) )
我需要一个解决方案,其中视图显示 (-),其中未在结果数组中找到主题数组中的子代码。