title: update button in each row of the table displayed
body: <p>I want to display all rows from the table and i want to get update button in each row  with the date option displayed. But i am getting below error: </p>
  
  <blockquote>
    <p>undefined index br, rg, batch</p>
  </blockquote>
  
  <p>I didn't get where i went wrong. I am giving my code. When i click the update button in the respective row, the SQL table gets updated with the respective <code>date</code> to the respective <code>rollnumber</code>.</p>
  
  <pre><code> &lt;html&gt;
       &lt;head&gt;
         &lt;link rel="stylesheet" type="text/css" href="header.css" /&gt;
         &lt;script src="jquery.min.js"&gt;&lt;/script&gt;
         &lt;link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/&gt;
          &lt;script src="https://code.jquery.com/jquery-1.12.4.js"&gt;&lt;/script&gt;
          &lt;script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"&gt;                    &lt;/script&gt;
          &lt;script&gt;
            $( function() {
                 $( ".date" ).datepicker({dateFormat:'yy-mm-dd'});
               } );
  
        &lt;/script&gt;
       &lt;style&gt;
         body 
         {
              background-color: #FFFFF2;
         }
       .date
       {
          width:70px;
       }
      .design
      {
  
         border: 1px solid red;
         border-collapse:collapse;
          text-align:center;  
      }
  
           tr
            {
            height:35px;
              }
             th
          {
               background-color:lightgreen;
            border: 1px solid red;
           height:50px;
  
            }
             td
            { 
             border: 1px solid red;
            font-size:13px;
              height:10px; 
             }
                  .design tr:hover
            {
          background-color:#FFA600;
             font-weight:bold;
           }
          &lt;/style&gt;
           &lt;/head&gt;
  
             &lt;?php
  
            include('connect.php');
  
  
              $br=$_POST['branch'];
              $rg=$_POST['reg'];
              $batch=$_POST['batch'];
  
  
               $br1=0;
               $year=0;
               $sem=0;
  
               if($rg=='R13')
             {
  
             if($br==1)
                {
             $br1="CIVIL";
              }
                else if($br==2)
               {
             $br1="EEE";
               }
                 else if($br==3)
                {
               $br1="MECH";
                }
                  else if($br==4)
                {
               $br1="ECE";
                    }
                else if($br==5)
                  {
                      $br1="CSE";
                  }
                     else
                         {
                   $br1="IT";
                         }
  
  
                        echo"&lt;center&gt;&lt;u&gt;&lt;h2&gt;Degree Eligibility List($br1)                                                                             ($batch batch)&lt;/h2&gt;&lt;/u&gt;&lt;/center&gt;";
  
                      $sl=1;
                       $i=1;
                        $k=0;
                 $mrk=0;
                 $int=0;
                  $ext=0;
                 $bl=0;
                $marks=0;
                 $total=0;
                 $crd=0;
                $per=0;
                 $grade=0;
  
               echo"&lt;center&gt;&lt;table class='design'&gt;"; 
               echo"&lt;thead&gt;&lt;th&gt;S.No&lt;/th&gt;
                &lt;th&gt;Roll Number&lt;/th&gt;
                 &lt;th&gt;Obtained&lt;/th&gt;
                 &lt;th&gt;MaxMarks&lt;/th&gt;
                  &lt;th&gt;Percent&lt;/th&gt;
                    &lt;th&gt;credits&lt;/th&gt;
                       &lt;th&gt;Backlogs&lt;/th&gt;
                    &lt;th&gt;Eligibility&lt;/th&gt;
                         &lt;th&gt;PC mode&lt;/th&gt;
                     &lt;th&gt;PC apply date&lt;/th&gt;
                      &lt;th&gt;PC recieve date&lt;/th&gt;
                       &lt;/thead&gt;"; 
  
                        $sql1="select rollno from pc where branch='$br' and       batch='$batch'";
                        $ret1=mysql_query($sql1);
                      while($row1=mysql_fetch_array($ret1))
                           {
                           //echo"&lt;tr&gt;";
                         //echo"&lt;td&gt;".$sl++."&lt;/td&gt;";
                               $rno=$row1['rollno'];
                          $sql="select * from data where rollno='$rno'  order by year asc, sem asc, subcode asc, my desc, type desc";   
                       $ret=mysql_query($sql);
  
  
                     while($row=mysql_fetch_array($ret))
                     {
                       $int=$row['internal'];
                          $ext=$row['external'];
                             $j=$row['credits'];
                                  $temp=$row['subcode'];
  
                       if(strcmp($temp,$k)&lt;&gt;0)
                         {
                        $sql2="select * from sforms where scode='$temp'";   
                        $ret_sub=mysql_query($sql2);
                        $row_fetch=mysql_fetch_array($ret_sub);
                           $max=$row_fetch['maxmarks'];
  
                          if($row['external']=='-1')
                            {
                          $mrk=$int;            
                             }
                              else
                                {
                                $mrk=$row['internal']+$row['external'];         
                                  }
  
                                 if($j==0)
                                   {
                                 $bl++;
                                 $marks=$marks+$mrk;
                                 $total=$total+$max;                     
                                 }
                                    else
                                     {
                               $marks=$marks+$mrk;
                               $total=$total+$max;    
                                $crd=$crd+$j;                     
                                 }        
  
                               $k=$temp;   
                                  } 
  
                                 }
                                if($total&lt;&gt;0)
                                {
                             $per=round(($marks/$total)*100,2);
                              echo"&lt;tr&gt;";
                              echo"&lt;td&gt;".$sl++."&lt;/td&gt;";
                              echo"&lt;td&gt;$rno&lt;/td&gt;";
                              echo"&lt;td&gt;$marks&lt;/td&gt;";
                              echo"&lt;td&gt;$total&lt;/td&gt;";
                              echo"&lt;td&gt;$per&lt;/td&gt;";
                              echo"&lt;td&gt;$crd&lt;/td&gt;";
                              echo"&lt;td&gt;$bl&lt;/td&gt;";
                              if($bl==0)
                              {
                             echo"&lt;td&gt;Eligible&lt;/td&gt;";
                             echo"&lt;td&gt;&lt;form method='post' action=''&gt;          
                              &lt;select name='mode' required&gt;
                                 &lt;option value=''&gt;--select--&lt;/option&gt;
                                 &lt;option value='T'&gt;Tatkal&lt;/option&gt;
                                 &lt;option value='C'&gt;College&lt;/option&gt;
                                 &lt;/select&gt;&lt;/td&gt;";
                           echo"&lt;td&gt;&lt;input  type='text' name='date'  class='date' required&gt;&lt;input type='submit' name='Submit' class='submit'       value='Update' /&gt;&lt;/form&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;";        
                                  }
                                  else
                                  {
                                 echo"&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;";
  
                                 }
                                   }
  
                          $marks=0;
                           $total=0;
                          $per=0;
                            $bl=0;
                             $crd=0;
  
                               }  
                                echo"&lt;/table&gt;&lt;/center&gt;";
                                   }  
  </code></pre>