title: I'm Trying to Create a search field
body: <p>I am trying to create a search field in <code>PHP</code> and <code>HTML</code>. My code is not showing any error message, however it doesn't echo anything. My search page comes up blank.</p>
  
  <p>Here is my PHP code:</p>
  
  <pre><code>&lt;?php
    require './includes/databaseHandler.php';
  
    if(isset($_POST['submit-search'])){
      $search = mysqli_real_escape_string($con, $_POST['search']);
      $location = mysqli_real_escape_string($con, $_POST['location']);
      $sql = "SELECT * FROM business WHERE BusinessName LIKE '%$search%' OR Address LIKE '%$search%'";
      $result = mysqli_query($con, $sql);
      $QueryResult = mysqli_num_rows($result);
  
      if($QueryResult &gt; 0){
        while ($row = mysqli_fetch_assoc($result)){
          $url = $row['BusinessName']."&lt;br/&gt;";
          echo "&lt;a href='Businesspage.php?id={$row['id']}'&gt;" . $url . "&lt;/a&gt;";
          echo $row['Address']."&lt;br/&gt;";
          echo $row['Phone']."&lt;br/&gt; &lt;hr&gt;";
        }
      }else{
        echo "There are no result matching your search";
      }
    }
  ?&gt;
  </code></pre>
  
  <p>And my HTML code from the search form:</p>
  
  <pre><code>&lt;form action="searchindex.php" method="POST"&gt;
    &lt;input id="form-control" class="form-control" type="text" placeholder="What are you looking for?" name="search"&gt;&lt;i id="form-control" class="fa fa-map-marker" aria-hidden="true"&gt;&lt;/i&gt;
    &lt;input id="form-control" class="form-control" type="text" placeholder="Jabi, Abuja?" name="location"&gt;
    &lt;button class="btn btn-default" type="submit-search"&gt;&lt;i class="fa fa-search"&gt;&lt;/i&gt;&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>