Hi,
I have this piece of code on a page name "main_page.php".I have 16 similar
questions in all on this page.The select tags for each question has the name
attribute qst1 to qst16 for question 1 to 16.
<form method="GET" action="fill_confirm.php">
// there is more html here
<tr>
<td height="1" colspan="3"> 1. State course objectives
and content clearly?</td>
<td width="50%" height="1" align="left"><p>
<select width="150" size="1" name="qst1">
<option value'z'>Select one</option>
<option value='a'>1. Poor</option>
<option value='b'>2. Satisfactory</option>
<option value='c'>3. Average</option>
<option value='d'>4. Good</option>
<option value='e'>5. Very good</option>
</select>
</p></td>
</tr>
// more code
<input type="submit" value="Submit" name="B1" size="100"></td><td width="7%"> <input type="reset" value="Cancel" name="B2" size="100"></td>
<td width="13%"> </td>
Now on the target page "fill_confirm.php" I try using a loop to update the database I am using.
for ($i=2;$i<3;$i++)
{
$qst_no_db="q".$i;
$qst_no="$"."qst".$i;
$score_no=assgn_score($qst_no);
echo $score_no;
$query = "UPDATE EE_375 SET ".$qst_no_db."='".$score_no."' where std_id='".$std_id."'";
$result= mysql_query( $query);
if (!$result)
{
echo "Cannot run query3.";
exit;
}
}
I expect $qst_no to contain the variables for the select tags.
But it's not.Wassup: