help with yes/no radio button for multiple questions pull from database
<p>hey guys i need a little help with this questionaire form. </p>

<p>The tables currently using are: </p>

<pre><code>  user
    userid| username

answers
aswerid|quesid|ans|userid|date

ques
quesid|ques 
</code></pre>

<p>The form below is what im using however i'm gettin errors for radio button.... could anyone offer advice?</p>

<pre><code> $query = mysql_query("SELECT * FROM ques", $con) 
                            or die("Cannot Access tblprequeations From Server");
        echo"&lt;div id='quesform' class='quesform'&gt;";     
    echo"&lt;form name='QForm' method='post' action='answers.php' onsubmit='return validateQForm(this);'&gt;";

    echo"&lt;p&gt;";
        while($row = mysql_fetch_array($query))
        {
        echo"&lt;p&gt;";

            echo"&lt;label&gt;".$row['quesid']."&lt;/label&gt;&amp;nbsp; &amp;nbsp;";
            echo"&lt;label&gt;".$row['ques']."&lt;/label&gt;&amp;nbsp; &amp;nbsp;";
    echo"&lt;input type='radio' name='ans' value='yes' if (isset($_POST['ans']) &amp;&amp; $_POST['ans'] == 'yes') echo'checked'/&gt;";
    echo"&lt;input type='radio' name='ans' value='no' if (isset($_POST['ans']) &amp;&amp; $_POST['ans'] == 'no') echo'checked'/&gt;";

        echo"&lt;/p&gt;";
        }
        echo"&lt;/p&gt;";
</code></pre>
