malatamil 9 Junior Poster

In this each member has 3 type of project selection. if one member has selected "regular Project" then remaining types should be displayed in dropdown for each member.

But here i tried with this code.. example i have 6 members, then 6 members can have 3 type of selections.. if i select "Regular Project" for 1'st member its selecting 6'th (last) member selection(FSA Project) is inserting into tables... i have a multiple member selection...

i added image..

How to solve this issue?

 $sql1 = "SELECT Select_Type,Prj_Id,Status FROM PROJECT_ACTIVE WHERE Memr_Id='$q2[0]'";
    $test = mysql_query($sql1);

   $s=0;
   while($test1 = mysql_fetch_array($test))
   {

   if ( $test1[0] == "Regular Project"){
           $s = $s + 1;
           //echo "<br> 3 ".$s;
       }
       if ( $test1[0] == "FSA Project"){
           $s = $s + 2;
           //echo "<br> 2".$s;
       }
       if ( $test1[0] == "TGF Project"){
                  $s = $s + 4;
                  //echo "1 ".$s;
       }



   }
   //echo "display".$s;
      switch($s)
   {
       case 0:
   //echo "ADD".$name;
   echo "<select name='selecttype'>";
   echo "<option value='Regular Project'>Regular Project</option>";
   echo "<option value='FSA Project'>FSA Project</option>";
   echo "<option value='TGF Project'>TGF Project</option>";
   echo "</select></td>";
   echo "<input type='hidden' name='mid' value='$q2[0]'>";
   echo "<td width='140'><textarea rows='2' name='comments[]' cols='20' ></textarea></td>\n";
   echo "</tr>\n";
   break;

   case 1:
   echo "<select name='selecttype'>";
   echo "<option value='FSA Project'>FSA Project</option>";
   echo "<option value='TGF Project'>TGF Project</option>";
   echo "</select></td>";
   echo "<input type='hidden' name='mid' value='$q2[0]'>";
   echo "<td width='140'><textarea rows='2' name='comments[]' cols='20' ></textarea></td>\n";
   echo "</tr>\n";
   break;

   case 2:
   echo "<select name='selecttype'>";
   echo "<option value='Regular Project'>Regular Project</option>";
   echo "<option value='TGF Project'>TGF Project</option>";
   echo "</select></td>";
   echo "<input type='hidden' name='mid' value='$q2[0]'>";
   echo "<td width='140'><textarea rows='2' name='comments[]' cols='20' ></textarea></td>\n";
   echo "</tr>\n";
   break;

   case 3:
   //global $var;
   //$var = $q2[1];

   //echo "VALUE".$var;
   echo "<select name='selecttype' >";
   echo "<option value='TGF Project'>TGF Project</option>";
   echo "</select></td>";
   echo "<input type='hidden' name='mid1' value='$var'>";
   echo "<td width='140'><textarea rows='2' name='comments[]' cols='20' ></textarea></td>\n";
   echo "</tr>\n";
   break;

   case 4:
   echo "<select name='selecttype'>";
   echo "<option value='Regular Project'>Regular Project</option>";
   echo "<option value='FSA Project'>FSA Project</option>";
   echo "</select></td>";
   echo "<input type='hidden' name='mid' value='$q2[0]'>";
   echo "<td width='140'><textarea rows='2' name='comments[]' cols='20' ></textarea></td>\n";
   echo "</tr>\n";
   break;

   case 5:
   //echo "ADDING";
   echo "<select name='selecttype'>";
   echo "<option value='FSA Project'>FSA Project</option>";
   echo "</select></td>";
   echo "<input type='hidden' name='mid' value='$q2[0]'>";
   echo "<td width='140'><textarea rows='2' name='comments[]' cols='20' ></textarea></td>\n";
   echo "</tr>\n";
   break;

   case 6:
   echo "<select name='selecttype'>";
   echo "<option value='Regular Project'>Regular Project</option>";
   echo "</select></td>";
   echo "<input type='hidden' name='mid' value='$q2[0]'>";
   echo "<td width='140'><textarea rows='2' name='comments[]' cols='20' ></textarea></td>\n";
   echo "</tr>\n";
   break;

   case 7:
   break;
   }