title: Search data table with Date
body: <p>I have a data table which is the result of one form submission, the form has start_date and end_date where its type is <code>DATETIME-LOCAL</code>.</p>
  
  <p>In my database its <code>DATETIME</code> (not showing AM and PM),<br>
  I want to add search function to my data table based on the date not date and time,</p>
  
  <p>Other type of search based on TYPE and NAME are working but date doesn't show nor error and results.</p>
  
  <pre><code>&lt;form action="search.php" id="searchform" method="POST" class="searchbox-container"&gt;
      &lt;input type="text" id="searchbox" placeholder="Search" name="searchbox" class="searchbox" /&gt;
      &lt;input type="date" name="date"&gt;
  
      &lt;select name="select" id="select"&gt;
          &lt;option value="type"&gt;Type&lt;/option&gt;
          &lt;option value="name"&gt;Name&lt;/option&gt;
      &lt;/select&gt;
      &lt;input type="submit" name="search" class="searchbox-btn" value="Go" /&gt;
  
  &lt;/form&gt;
  
  &lt;?php
  
      if(isset($_POST['search'])){
          $search=preg_replace('#[^a-z 0-9?!]#i','',$_POST['searchbox']);
  
  
          $user="admin";
          $pass="neehahs";
          $host="localhost";
          $db_name="eventregisteration";
  
          $con=mysqli_connect($host, $user, $pass, $db_name);
          if(mysqli_connect_errno($con)){
              echo "Failed to connect to MySQL: " . mysqli_connect_error();
          }
  
          $date=$_POST['date'];
  
  
          if($_POST['select']=="type"){
              $sqlcommand="SELECT * FROM eventform WHERE event_type LIKE '%$search%'";    
  
  
          }
          elseif($_POST['select']=="name"){
              $sqlcommand="SELECT * FROM eventform WHERE event_name LIKE '%$search%'";        
  
  
          }
          else {
              if($date!=0)
                  $sqlcommand="SELECT * FROM eventform WHERE start_date='$date' ORDER BY start_date DESC";    
  
  
          }
          $sqldata=mysqli_query($con,$sqlcommand)
              or die("Error Getting Data");
  
          $count=mysqli_num_rows($sqldata);
          if($count!=0){
  
              echo "&lt;table border=2 bordercolor=#440000 cellpadding=2 bgcolor=#DDDDDD width=100%&gt;";
              echo "&lt;tr bgcolor=#555555 style=font-size:18px align=center&gt;&lt;th&gt;Event Code&lt;/th&gt;&lt;th&gt;Event Name&lt;/th&gt;&lt;th&gt;Event Type&lt;/th&gt;&lt;th&gt;Event Level&lt;/th&gt;&lt;th&gt;Start Date&lt;/th&gt;
        &lt;th&gt;End Date&lt;/th&gt;&lt;th&gt;Point&lt;/th&gt;&lt;th&gt;Picture&lt;/th&gt;&lt;th&gt;Video&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;";
              while($row=mysqli_fetch_array($sqldata)){
                  echo "&lt;tr align=center&gt;&lt;td&gt;";
                  echo $row['event_code'];
  
                  echo "&lt;/td&gt;&lt;td&gt;";
                  echo $row['event_name'];
                  echo "&lt;/td&gt;&lt;td&gt;";
  
                  echo $row['event_type'];
                  echo "&lt;/td&gt;&lt;td&gt;";
  
                  echo $row['event_level'];
                  echo "&lt;/td&gt;&lt;td&gt;";
  
                  echo $row['start_date'];
                  echo "&lt;/td&gt;&lt;td&gt;";
  
                  echo $row['end_date'];
                  echo "&lt;/td&gt;&lt;td&gt;";
  
                  echo $row['points'];
                  echo "&lt;/td&gt;&lt;td&gt;";
  
                  echo "&lt;a href=http://localhost/greenstudio/".$row['pic']."&gt;".$row['pic']."&lt;/a&gt;";
                  echo "&lt;/td&gt;&lt;td&gt;";
  
                  echo "&lt;a href=http://localhost/greenstudio/".$row['video']."&gt;".$row['video']."&lt;/a&gt;";
                  echo "&lt;/td&gt;&lt;td&gt;";
  
                  echo $row['description'];
                  echo "&lt;/td&gt;&lt;/tr&gt;";
  
              }
              echo "&lt;/table&gt;";
  
          }else{
              echo "hi";
              $search_output="&lt;hr/&gt;0 Results for&lt;strong&gt;$search&lt;/strong&gt;&lt;hr/&gt;";
  
          }
      }
  
  ?&gt;
  </code></pre>