<input type="radio" name="a<?php echo $i;?>" value="good">good

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pmcalmc

    <input type="radio" name="a<?php echo $i;?>" value="good">good

    Code:
    if(isset($_POST['onsub'])){
          
          for($i=0;$i<4;$i++){
             
                     $t=$_POST["a$i"];
                     
                     echo "hello"."a$i";
                    switch ($t){
                          case "good":
                                       $q2 = "update teacher set good=good+1 where teacher_name='$tname'";
                                         $r = mysql_query($q2, $con);
                                            if (!$r)
                                            echo "error";
                                            continue;                                                 
                             case "average":
                                        $q2 = "update teacher set average=average+1 where teacher_name='$tname' ";
                                        mysql_query($q2, $con);
                                        continue;
                          case "excellent":
                                        $q2 = "update teacher set excellent=excellent+1 where teacher_id='$tname'";
                                        mysql_query($q2, $con);
                                        continue;
                         default:
                                        echo "please select one";
     }       
    
    }
    }
    i want to use a0,a1 ....in loop
    plz help me thnk u.....
    Last edited by MMcCarthy; Oct 17 '10, 09:35 PM. Reason: added code tags
Working...