title: Filter results based on user input
body: <p>I am currently working on a kind of "list", where users can put in different data to create a kind of log for various activities, specifically in simulators. I got the basics of it layed down and in fact fully up and running, however, theres still one component, rather critical to me. This being, the users ALSO being able to search for the author of the route. So look at it like this:</p>
  
  <p>Name - Distance - Date</p>
  
  <p>Bob - 100km - 01-01-2015</p>
  
  <p>Jones - 200km - 01-01-2015</p>
  
  <p>Jones - 250km - 01-01-2015</p>
  
  <p>This, is essentially the list the users would see. If the users put in "Jones", they should only see the result of Jones. However, I cannot get this to work.</p>
  
  <p>The code I am currently using to try to achieve the "filter" :</p>
  
  <pre><code>&lt;div class="filters"&gt;
          &lt;ul&gt;
              &lt;li&gt;
                  &lt;form method="POST" action="index.php?category=trucking"&gt;
                      &lt;input type="text" name="filterName" /&gt;
                      &lt;input type="submit" name="submit" label="Search for Author" /&gt;
                  &lt;/form&gt;
              &lt;/li&gt;
              &lt;li&gt;
                  &lt;a href="index.php?category=addEntryFT"&gt;&lt;b&gt;Add a entry&lt;/b&gt;&lt;/a&gt;
              &lt;/li&gt;
          &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class="results"&gt;
  
          &lt;?php
              // Get from database
                        if(isset($_POST['submit'])) {
  
                        $filterName = $_POST['filterName'];
  
                        $result = mysqli_query($anslutning, "SELECT * FROM tblLogs WHERE category = 'trucking' AND author LIKE '$filterName'");
                          }
  
          ?&gt;
  </code></pre>
  
  <p>So first I create a form where the user puts in a author, and whatever they put in, should apply. Two issues :</p>
  
  <p>1) The form makes the page redirect to the previous page, and 2) it doesn't filter out anything</p>
  
  <p>So in its very basic, pretty much a search bar that points to a database and checks the records there, and this is all I have to come with, which obviously does not work.</p>