1

I've been working on an RFID attendance system and at the end, I'm stuck with a small problem.

The problem is that I want to display the number of students that made an entry on a particular date. This would help in getting the students that attended the class and students that were absent.

My html code is:

                <form action="dateview.php" method="post">
           <table width="60%" border="2" bordercolor="green">
              <tr>
              <td>DATE</td>
            <td>
            <input type="date" name="date">
                    </td>
            <td colspan="2"><center><input type="submit" value="search"/></center></td>
            </table>    
            </form> 

My dateview.php code is :

<?php 
  require_once 'connect.php';
$time = strtotime($_POST['date']);
if ($time) {
  $new_date = date('Y-m-d', $time);
  echo $new_date;
  $sql1 = "SELECT COUNT(*) AS date FROM time WHERE date = '".$new_date."'";
  $result = $conn->query($sql1);
  print_r($result);
} else {
  // fix it.
}

?>

And my sql table (time) is as displayed: SQL TABLE TIME

Anas Mansuri
  • 159
  • 1
  • 2
  • 13

0 Answers0