hello , can u plaese help me guys
I have tried several ways to UPDATE data to a mysql database from radio buttons that have 1,2,3,4 options..
for submitting i have used
if (isset($_POST['submit']))
{
$v1 = intval($_POST['v1']);
$v2 = intval($_POST['v2']);
$v3 = intval($_POST['v3']);
$v4 = intval($_POST['v4']);
$v5 = intval($_POST['v5']);
$v6 = intval($_POST['v6']);
$v7 = intval($_POST['v7']);
$v8 = intval($_POST['v8']);
$total = $v1 + $v2 + $v3 + $v4 + $v5 + $v6 + $v7 + $v8 ;
$Percentage = $total / 32 * 10 ;
mysql_query("UPDATE grades_presentation SET P1='$v1',P2='$v2',P3='$v3',P4='$v4',P5='$v5',P6='$v6',P7='$v7',P8='$v8',TOTAL='$total',Percentage='$Percentage' WHERE SID='$id' ") or die(mysql_error());
header("Location: mark.php");
And this is some of the questions, I have used Checked to give me which button user have checked before!
<tr>
<th bgcolor='FF6600'> Clarity of speaking
(Could you hear the speaker properly and clearly?)<font size="4" > </font></th>
<td> <input type="radio" name ="v1" value = "4" <?php echo ($v1=='4')?'checked':'' ?> onclick="updateTotal();" /></td>
<td> <input type="radio" name ="v1" value = "3" <?php echo ($v1=='3')?'checked':'' ?> onclick="updateTotal();" /></td>
<td> <input type="radio" name ="v1" value = "2" <?php echo ($v1=='2')?'checked':'' ?> onclick="updateTotal();" /></td>
<td> <input type="radio" name ="v1" value = "1" <?php echo ($v1=='1')?'checked':'' ?> onclick="updateTotal();" /></td>
</tr>
<tr>
<th bgcolor='FF6600'> Audio-visuals?(Use of OHP, Board etc.)<font size="4" > </font></th>
<td> <input type="radio" name ="v2" value = "4" <?php echo ($v2=='4')?'checked':'' ?> onclick="updateTotal();" /></td>
<td> <input type="radio" name ="v2" value = "3" <?php echo ($v2=='3')?'checked':'' ?> onclick="updateTotal();" /></td>
<td> <input type="radio" name ="v2" value = "2" <?php echo ($v2=='2')?'checked':'' ?> onclick="updateTotal();"/></td>
<td> <input type="radio" name ="v2" value = "1" <?php echo ($v2=='1')?'checked':'' ?> onclick="updateTotal();" /></td>
</tr>
all working fine but when i changed some values and click submit nothing changed in the database !