can Anyone help me on how to inser the values to table
Posted: Tue Nov 25, 2008 10:56 am
<html>
<head>
<title>TEST QUESTIONNAIRE</title>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<?
require "config.php"; // user passwd dbname
$limit = 5; // No of records to be shown per page.
$query2=" SELECT * FROM TEST_EXAMS ";
$result2=mysql_query($query2);
echo mysql_error();
$nume=mysql_num_rows($result2);
?>
<table width=80% align=center cellpadding=0 cellspacing=0 border=0>
<tr>
<td bgcolor='dfdfdf'>
<font bgcolor='#dfdfdf' face='arial,verdana,helvetica' style='font-weight: 300' color='#000000'><h2 align="center">QUESTIONNAIRE</h2></font>
</td>
</tr>
</table>
<table align=center border=1 width=80% height=150>
<tr>
<td width=100% id=ex align=center colspan=9>Module : <? echo $info['module_no']; ?> </td>
</tr>
<?
$query=" SELECT * FROM TEST_EXAMS limit $limit ";
$result=mysql_query($query);
echo mysql_error();
while($info = mysql_fetch_array( $result ))
{
?>
<tr>
<td colspan=9><br>
</td>
</tr>
<tr>
<td width=5% id=ex>Question :<? echo $counter++; ?></td>
<td colspan=9 width=100%> <font size="5"><? echo $info['question']; ?></font></td>
</tr>
<tr>
<td colspan=9><br>
</td>
</tr>
<td align=center colspan=9 id=ex>Choices</td>
</tr>
<form name="thisForm" action="TESTINSERT.PHP" method="post">
<tr><td width=5%> </td>
<td colspan=9 width=500><input type="radio" value="<? echo $info['choice_1']; ?>" name="radio_<?php echo $counter;?>"><? echo $info['choice_1']; ?><br></td>
</tr>
<tr><td width=5%> </td>
<td colspan=9 width=500><input type="radio" value="<? echo $info['choice_2']; ?>" name="radio_<?php echo $counter;?>"><? echo $info['choice_2']; ?><br></td>
</tr>
<tr><td width=5%> </td>
<td colspan=9 width=500><input type="radio" value="<? echo $info['choice_3']; ?>" name="radio_<?php echo $counter;?>"><? echo $info['choice_3']; ?><br></td>
</tr>
<tr><td width=5%> </td>
<td colspan=9 width=500><input type="radio" value="<? echo $info['choice_4']; ?>" name="radio_<?php echo $counter;?>"><? echo $info['choice_4']; ?><br></td>
</tr>
<?
}
?>
</table>
<table border=0 width=80% align="center">
<tr>
<td align="center">
<input id="ex" type="submit" name="submit" value="Submit" >
</form>
</td>
</tr>
</table>
</body>
</html>
<head>
<title>TEST QUESTIONNAIRE</title>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<?
require "config.php"; // user passwd dbname
$limit = 5; // No of records to be shown per page.
$query2=" SELECT * FROM TEST_EXAMS ";
$result2=mysql_query($query2);
echo mysql_error();
$nume=mysql_num_rows($result2);
?>
<table width=80% align=center cellpadding=0 cellspacing=0 border=0>
<tr>
<td bgcolor='dfdfdf'>
<font bgcolor='#dfdfdf' face='arial,verdana,helvetica' style='font-weight: 300' color='#000000'><h2 align="center">QUESTIONNAIRE</h2></font>
</td>
</tr>
</table>
<table align=center border=1 width=80% height=150>
<tr>
<td width=100% id=ex align=center colspan=9>Module : <? echo $info['module_no']; ?> </td>
</tr>
<?
$query=" SELECT * FROM TEST_EXAMS limit $limit ";
$result=mysql_query($query);
echo mysql_error();
while($info = mysql_fetch_array( $result ))
{
?>
<tr>
<td colspan=9><br>
</td>
</tr>
<tr>
<td width=5% id=ex>Question :<? echo $counter++; ?></td>
<td colspan=9 width=100%> <font size="5"><? echo $info['question']; ?></font></td>
</tr>
<tr>
<td colspan=9><br>
</td>
</tr>
<td align=center colspan=9 id=ex>Choices</td>
</tr>
<form name="thisForm" action="TESTINSERT.PHP" method="post">
<tr><td width=5%> </td>
<td colspan=9 width=500><input type="radio" value="<? echo $info['choice_1']; ?>" name="radio_<?php echo $counter;?>"><? echo $info['choice_1']; ?><br></td>
</tr>
<tr><td width=5%> </td>
<td colspan=9 width=500><input type="radio" value="<? echo $info['choice_2']; ?>" name="radio_<?php echo $counter;?>"><? echo $info['choice_2']; ?><br></td>
</tr>
<tr><td width=5%> </td>
<td colspan=9 width=500><input type="radio" value="<? echo $info['choice_3']; ?>" name="radio_<?php echo $counter;?>"><? echo $info['choice_3']; ?><br></td>
</tr>
<tr><td width=5%> </td>
<td colspan=9 width=500><input type="radio" value="<? echo $info['choice_4']; ?>" name="radio_<?php echo $counter;?>"><? echo $info['choice_4']; ?><br></td>
</tr>
<?
}
?>
</table>
<table border=0 width=80% align="center">
<tr>
<td align="center">
<input id="ex" type="submit" name="submit" value="Submit" >
</form>
</td>
</tr>
</table>
</body>
</html>