Table with data:
id score inputid
1 1 1
2 4 1
3 3 1
4 1 2
5 2 2
6 3 5
7 1 6
8 1 6
while ($stmt_score->fetch())
{
if($bind_inputid == '1') $array['score'][0] += $bind_score;
if($bind_inputid == '2') $array['score'][1] += $bind_score;
if($bind_inputid == '5') $array['score'][2] += $bind_score;
if($bind_inputid == '6') $array['score'][3] += $bind_score;
}
如上所述,我想将所有结果与特定ID相加。但是由于会有更多的$ bind_inputid ID,我的问题是,如何为自己的ID更多的结果自动声明?在while循环中特定ID的组结果
它必须在while循环中完成,而不是使用mysql select。 PHP Lang。 Thx。
如何至少提您所使用的编程语言? – 2011-06-06 19:19:33
sry,; p,它的php – Cameleon 2011-06-06 19:21:21