title: how to take attendance for each and every student
body: <p>I want take attendance of grade1 class and store the attence of the class in database.But in following code only the last student attendance value is stored in database.But i need all students value to be stored in db.</p>
  
  <p>This is my form code: </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;grade1&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;table border="1" cellspacing="1" cellpadding="1" width="200" height="200"&gt;
  &lt;tr&gt;
  &lt;th&gt;classid&lt;/th&gt;
  &lt;th&gt;studentid&lt;/th&gt;
  &lt;th&gt;teacherid&lt;/th&gt;
  &lt;th&gt;locid&lt;/th&gt;
  &lt;th&gt;date&lt;/th&gt;
  &lt;th&gt;flag&lt;/th&gt;
  &lt;th&gt;comments&lt;/th&gt;
  &lt;/tr&gt;
  &lt;?php
    include 'conn.php';
    $query = "(SELECT  a.classid, a.fname, b.teacherid, c.locid
               FROM class_master c JOIN student_master a 
               ON c.classid = a.classid JOIN teacher_link b
               ON c.classid = b.classid 
               WHERE c.classid = 'grade1' )";
    $result = mysql_query($query);
  
  
  
    while( $row = mysql_fetch_array($result))
  {
    echo "&lt;form action=insertattend.php method=POST&gt;";
    echo "&lt;tr&gt;";
    echo "&lt;td&gt;" . "&lt;input type=text value=" .$row['classid']." &lt;/td&gt;";
    echo "&lt;td&gt;" . "&lt;input type=text value=" .$row['fname']." &lt;/td&gt;";
    echo "&lt;td&gt;" . "&lt;input type=text value=" .$row['teacherid']." &lt;/td&gt;";
    echo "&lt;td&gt;" . "&lt;input type=text value=" .$row['locid']." &lt;/td&gt;";
    echo "&lt;td&gt;" . "&lt;input name=date type=date value='date'&gt;&lt;/td&gt;";
    echo "&lt;td&gt;" . "&lt;input type=radio name=attend value='present'&gt;";?&gt;P
    &lt;?php echo "&lt;input type=radio name=attend value='absent'&gt;";?&gt;A
    &lt;?php
    echo"&lt;/td&gt;";
    echo "&lt;td&gt;&lt;input name=comment type=comment row=3 column=5&gt;&lt;/td&gt;";
    }
    echo "&lt;/tr&gt;";     
    ?&gt;
    &lt;/table&gt;
    &lt;input type="submit" value="submit"&gt;
    &lt;/form&gt;
    &lt;/body&gt;
    &lt;/html&gt;
  </code></pre>