我有一个小问题,我尝试进行在线测试,但我需要洗牌 answare 所以 1 是好的 answare 和 2,3 坏的但一直出现 a = 1 b = 2 c = 3 我想要一些随机化的东西a=2 b=3 c=1 我该怎么做?
代码在这里:
$result = mysql_query( "SELECT * FROM questions ORDER BY RAND() LIMIT 0,10");
while ($row = mysql_fetch_array($result)) {
$rows[] = $row;
$question_id = $row['question_id'];
$question = $row['question'];
$answare_good = $row['answare_good'];
$answare_badi = $row['answare_badi'];
$answare_badii = $row['answare_badii'];
$number += 1;
echo '<tr>
<td rowspan="3" width="10">'.$number.'</td>
<td rowspan="3" width="70%"><p>'.$question.'</p></td>
<td width="30%" height="33%"><input type="checkbox" name="a1" id="a1">
'.$answare_good.'</td>
</tr>
<tr>
<td width="30%" height="33%"><input type="checkbox" name="a2" id="a2">
'.$answare_badi.'</td>
</tr>
<tr>
<td width="30%" height="33%"><input type="checkbox" name="a3" id="a3">
'.$answare_badii.'</td>
</tr>';
我尝试了一些东西来排列洗牌 $answare_good & $answare_badi & $answare_badii 但我失败了。