title: search in php mysql with multiple search box
body: <p>I want to create a search with multiple search box. i already created on with the help of this tutorial <a href="https://www.youtube.com/watch?v=2XuxFi85GTw" rel="nofollow">https://www.youtube.com/watch?v=2XuxFi85GTw</a>. so I make it 2 text box for the search. Here's what i done:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
  if (isset($_POST['SearchTime']))
  {
    $ValueToSearch = $_POST['ValueToSearchTime'];
    $query = "SELECT `id`, `name`, `address`, `contact`, `email`, `date`, `time`, `ahc`, `chc`, `cottage`, `total` FROM `reserve`  WHERE CONCAT (`time`) LIKE '%".$ValueToSearch."%' ORDER BY id DESC";
    $search_result = filterTable($query);
  }
  elseif (isset($_POST['ValueToSearchTime']) == "") {
    $query = "SELECT id, name, address, contact, email, date, time, ahc, chc, total, cottage FROM reserve ORDER BY id DESC";
    $search_result = filterTable($query);
  }
  
  elseif (isset($_POST['SearchCottage']))
  {
    $ValueToSearch = $_POST['ValueToSearchCottage'];
    $query = "SELECT `id`, `name`, `address`, `contact`, `email`, `date`, `time`, `ahc`, `chc`, `cottage`, `total` FROM `reserve`  WHERE CONCAT (`cottage`) LIKE '%".$ValueToSearch."%' ORDER BY id DESC";
    $search_result = filterTable($query);
  }
  elseif (isset($_POST['ValueToSearchCottage']) == "") {
    $query = "SELECT id, name, address, contact, email, date, time, ahc, chc, total, cottage FROM reserve ORDER BY id DESC";
    $search_result = filterTable($query);
  }
  
  function filterTable($query)
  {
    $connect = mysqli_connect("localhost","root","","resort");
    $filter_Result = mysqli_query($connect,$query);
    return $filter_Result;
  }
  
  ?&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Search Table&lt;/title&gt;
    &lt;link rel="stylesheet" href="lib/table.css" media="screen" title="no title" charset="utf-8"&gt;
    &lt;link rel="stylesheet" href="lib/style.css" media="screen" title="no title" charset="utf-8"&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form action="index.php" method="post"&gt;
    &lt;div class="container"&gt;
      &lt;div class="TableGenerator"&gt;
        &lt;table&gt;
          &lt;tr&gt;
            &lt;td&gt;No.&lt;/td&gt;
            &lt;td&gt;Name&lt;/td&gt;
            &lt;td&gt;Address&lt;/td&gt;
            &lt;td&gt;Contact&lt;/td&gt;
            &lt;td&gt;Email Address&lt;/td&gt;
            &lt;td&gt;Date&lt;/td&gt;
            &lt;td&gt;
              Time&lt;br/&gt;
              &lt;input type="text" name="ValueToSearchTime" class="txt" placeholder="Search Time"/&gt;
              &lt;input type="submit" name="SearchTime" value="&gt;&gt;"/&gt;
            &lt;/td&gt;
            &lt;td&gt;HeadCount &lt;br/&gt; &lt;i&gt;Adult&lt;/i&gt;&lt;/td&gt;
            &lt;td&gt;HeadCount &lt;br/&gt; &lt;i&gt;Child&lt;/i&gt;&lt;/td&gt;
            &lt;td&gt;Total&lt;br/&gt;Amount&lt;/td&gt;
            &lt;td&gt;
              Cottage No&lt;br/&gt;
              &lt;input type="text" name="ValueToSearchCottage" class="txt" placeholder="Search Cottage"/&gt;
              &lt;input type="submit" name="SearchCottage" value="&gt;&gt;"/&gt;
            &lt;/td&gt;
          &lt;/tr&gt;
          &lt;?php include ("includes/row.php"); ?&gt;
          &lt;?php while ($row = mysqli_fetch_array($search_result) ): ?&gt;
          &lt;tr&gt;
            &lt;td&gt;&lt;?php echo $row['id']; ?&gt;&lt;/td&gt;
            &lt;td&gt;&lt;?php echo $row['name']; ?&gt;&lt;/td&gt;
            &lt;td&gt;&lt;?php echo $row['address']; ?&gt;&lt;/td&gt;
            &lt;td&gt;&lt;?php echo $row['contact']; ?&gt;&lt;/td&gt;
            &lt;td&gt;&lt;?php echo $row['email']; ?&gt;&lt;/td&gt;
            &lt;td&gt;&lt;?php echo $row['date']; ?&gt;&lt;/td&gt;
            &lt;td&gt;&lt;?php echo $row['time']; ?&gt;&lt;/td&gt;
            &lt;td&gt;&lt;?php echo $row['ahc']; ?&gt;&lt;/td&gt;
            &lt;td&gt;&lt;?php echo $row['chc']; ?&gt;&lt;/td&gt;
            &lt;td&gt;&lt;?php echo $row['total']; ?&gt;&lt;/td&gt;
            &lt;td&gt;&lt;?php echo $row['cottage']; ?&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;?php endwhile;?&gt;
        &lt;/table&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>but i want to filter it both at the same time, when I input something in both searchbox. please help!</p>