title: simple attendance system with radio button
body: <p>I am making a simple attendance class system </p>
  
  <p>I have this php code with radio buttons here.. now i put it in a table</p>
  
  <p>I can only choose one radio button on the entire table instead of one radio button per registered account</p>
  
  <pre><code>&lt;?php
  session_start();
  if(!isset($_SESSION["in"]))
  {
      header("Location: log.php");
  }
  ?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Attendance&lt;/title&gt;
  
  &lt;/head&gt;
      &lt;body&gt;
  &lt;center&gt;
  &lt;br /&gt;
  &lt;?php
  echo "Today is " . date("m/d/Y") . "&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;";
  ?&gt;
  
  &lt;?php
  $conn= new mysqli("localhost", "root", "", "dbform");
  
      $sql = "SELECT * FROM tblusers";
  
  
  
  $result = $conn-&gt;query($sql);
  if ($result-&gt;num_rows &gt; 0) {
      echo "&lt;table width='1300' border='6'&gt; 
  
  &lt;tr&gt;
  &lt;th width='100'&gt;ID&lt;/th&gt;
  &lt;th width='100'&gt;Lastname&lt;/th&gt;
  &lt;th width='100'&gt;Firstname&lt;/th&gt;
  &lt;th width='100'&gt;Sex&lt;/th&gt;
  &lt;th width='100'&gt;Attendance&lt;/th&gt;
  &lt;/tr&gt;";
       // output data of each row
       while($row = $result-&gt;fetch_assoc()) {
           echo "&lt;tr&gt; ";
  echo "&lt;td align='center'&gt;2016" . $row['id'] . "&lt;/td&gt;";
  echo "&lt;td align='center'&gt;" . $row['lastname'] . "&lt;/td&gt;";
  echo "&lt;td align='center'&gt;" . $row['firstname'] . "&lt;/td&gt;";
  echo "&lt;td align='center'&gt;" . $row['sex'] . "&lt;/td&gt;";
  ?&gt;
  &lt;form method="post" action="Succes_Submit_Attendace.php" name="submit_attendance"&gt;
  
  attendance = 
  &lt;td align='center'&gt; &lt;label&gt;&lt;input type="radio" name="attendance" value="present"&gt;Present&lt;/label&gt;
                &amp;emsp;&lt;label&gt;&lt;input type="radio" name="attendance" value="absent"&gt;Absent&lt;/label&gt;&lt;br /&gt;&lt;br /&gt;
  
  &lt;?php  
  
  $row['attendance'] ;
  
  ?&gt; &lt;/td&gt;
  &lt;?php 
  echo " &lt;/tr&gt;";
  
       }
       echo "&lt;/table&gt;";
  } 
  else {
       echo "0 results";
  }
  $conn-&gt;close();
  ?&gt;   
  &lt;br&gt;
  &lt;br&gt;
  &lt;input type="reset"&gt;&amp;emsp;&lt;input type="submit" value="Submit Attendance"&gt;&lt;/h4&gt;
  &lt;/form&gt;
  
  
  &lt;div align="right"&gt;
   &lt;a href="admin.php"&gt;&lt;h3&gt;Back&lt;/h2&gt;&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>
  </p>