PHP测验中的SQL查询错误

My database table contains following fields:

id, question ,answer ,answer2 ,answer3 ,answer4 

the correct answer is in the answer field.

The problem is that when I select the correct answer and submit it, it shows it as the wrong answer. here is the HTML code:

$sql=mysql_query("SELECT * FROM `qs_ans_php`") or die(mysql_error());
$questionNumber = 1;
<td>Question:<?php echo $questionNumber; ?></td><td><?php echo $rt['question'];?></td>
</tr>
<tr>
<td><input type="radio" name="ans[<?php echo $rt['id'];?>]" value="a" /><?php echo $rt['answer'];?></td>
</tr>
<tr>
<td><input type="radio" name="ans[<?php echo $rt['id'];?>]" value="b" /><?php echo $rt['answer2'];?></td>
</tr>
<tr>
<td><input type="radio" name="ans[<?php echo $rt['id'];?>]" value="c" /><?php echo $rt['answer3'];?></td>
</tr>
<tr>
<td><input type="radio" name="ans[<?php echo $rt['id'];?>]" value="d" /><?php echo $rt['answer4'];?></td>

And this is the php code:

$correctAnswers = 0;
$wrongAnswers = 0;
$idList = join (',', array_map('intval', array_keys($_POST['ans'])));

$sql = mysql_query("SELECT `id`,`answer` FROM `qs_ans_php` WHERE `id` IN ($idList) ") or die(mysql_error());

while(list($id, $correct) = mysql_fetch_row($sql)) 
{

if ($correct == $_POST['ans'][$id])
 {
        $correctAnswers =+1;


}
else 
{
        $wrongAnswers +=1;
}

}
?>
<html>
<body>
<p>
<?php $numberOfQs = $correctAnswers + $wrongAnswers;
$score = round(($correctAnswers / $numberOfQs) * 100);
?>

Correct Answers: <?php echo $correctAnswers; ?> <br>
Wrong Answers: <?php echo $wrongAnswers; ?> <br>
Score: <?php echo $score; ?>