title: I want to mark attendance of a student once per day in my database
body: <p>I want to scan RFID cards from Arduino and it should mark attendance once per day not whenever it scans the card.</p>
  
  <p>This is the PHP code for marking attendance:</p>
  
  <pre><code>public function getRFIDAttendanceApi(){
      $rfid_uid = trim($_REQUEST['uid']);
      $sql = "select count(*)as tot from tbl_users where rfid_uid='$rfid_uid'";
  
      $data = $this-&gt;getData($sql);
      if(count($data)&gt;0 &amp;&amp; $data[0]['tot']&gt;0){
          $sql = "insert into tbl_attendance set rfid_uid='$rfid_uid'";
          $flag = $this-&gt;conn-&gt;query($sql);
          if($flag){
              echo "Attendance marked successfully!";
              die;
          } else {
              echo "Sorry! Something unexpected happened!";
              die;    
          }
      } else {
          echo "invalid access";die;
      }
  </code></pre>
  
  <p>This is the table in mysql for attendance with repeating marking</p>
  
  <pre><code>| att_id | rfid_uid | punch_timestamp     | date       | time     |
  +--------+----------+---------------------+------------+----------+
  |      1 | 85988145 | 2018-04-21 10:48:51 | 2018-04-21 | 10:48:51 |
  |      2 | 85988145 | 2018-04-21 10:48:52 | 2018-04-21 | 10:48:52 |
  </code></pre>
  
  <p>How to make it once per day? Thanks.</p>