PHP quiz script answer highlight
<p>I have a PHP script and MSSQL tables, I got the answer key in a variable stored in <code>$right_answer</code> and user selected answers in <code>$user_answer_select</code> THe format is something like this</p>

<pre><code>5+10?

A) 10
B) 15
C) 20
D) 25
E) 50

Answer key: B
</code></pre>

<p>what I want to do is put a check mark next to B if its correct and a X if it is wrong, how would I make the if else statements here?</p>

<p>This is the code I currently have</p>

<pre><code>if(($user_answer_select == $right_answer) &amp;&amp; $user_answer_select == 'a') $a_sel = "&lt;img src=\"tick_icon.gif\"&gt;";
else if(($user_answer_select == $right_answer) &amp;&amp; $user_answer_select == 'b') $b_sel = "&lt;img src=\"tick_icon.gif\"&gt;";
else if(($user_answer_select == $right_answer) &amp;&amp; $user_answer_select == 'c') $c_sel = "&lt;img src=\"tick_icon.gif\"&gt;";
else if(($user_answer_select == $right_answer) &amp;&amp; $user_answer_select == 'd') $d_sel = "&lt;img src=\"tick_icon.gif\"&gt;";
else if(($user_answer_select == $right_answer) &amp;&amp; $user_answer_select == 'e') $e_sel = "&lt;img src=\"tick_icon.gif\"&gt;";
</code></pre>

<p>This is wrong because some of the questions that don't have answers for are highlighted as true. What's the way to do this?</p>
