There are a lots of error in my code but I don't know which one of the error.
I'm trying to retrieve data from database and paste it into html but there are problem reading table. There are two tables from database one of it are diagnostic table and another one is diagnostic answer. The table of diagnostic contain 10 question and each question had 3 multiple choices answer that I put in diagnostic answer table. I'm also try to loop the question from the diagnostic table same as the answer.
<form name="question" action="diagnostic_test_process.php" method="post">`
<fieldset>
<table><?PHP
$sql=mysql_query("SELECT * FROM diagnostic")
or die ("Problem reading table:". mysql_error());
while ($result = mysql_fetch_array ($sql)){ ?>
<tr>
<td colspan="2">
<label for="question"></label>
<?PHP
echo "<p>".$result["id_diagnostic"].".";
echo $result["question"]."</p>"; ?>
</td>
</tr>
<?php
$sql=mysql_query
("SELECT a.id_answer, a.answer FROM diagnostic_answer a, diagnostic b WHERE a.id_diagnostic = b.id_diagnostic and a.id_diagnostic= " . $result["ïd_diagnostic"])
or die ("Problem reading table:". mysql_error());
while ($value= mysql_fetch_array ($sql)){ ?>
<tr>
<td>
<label for="answer"></label>
<p><input id=<?php echo $answer['id_answer']; ?> type='radio' name='answer' value='1' onClick="calculate()">
<?php echo $value['answer']; ?></p>
</td>
</tr>
<?php }
// close recordset
?>
<?php } ?>
</table>
</fieldset>