title: php search box results display incorrectly?
body: <p>I am trying to make a php search box using the following code but when i press submit, it displays all three entries in wallname instead of the one that is relative to the search.</p>
  
  <p>php:</p>
  
  <pre class="lang-php prettyprint-override"><code>if (isset($_POST['submit-search'])){
      $searchq= $_POST['search-input'];
      $query = mysqli_query($conn, "SELECT wallname FROM walldb WHERE 
         wallname LIKE '%$searchq%'");
      $result= mysqli_num_rows($query);
      if ($result = 0){
        echo "error search";
      } else{
        while($row = mysqli_fetch_assoc($query)){
            $name = $row['wallname'];
            $output = '&lt;div&gt;'.$name.'&lt;/div&gt;';
            print ("$output");
        }
      }
  }
  </code></pre>
  
  <p>html:</p>
  
  <pre><code> &lt;form action= "" method= "post"&gt;
          &lt;button type= "submit" name="submit-search"&gt;Search&lt;/button&gt;
          &lt;input id="search" name="search-input" type="text" placeholder="Search By Name" 
          autocomplete="off"&gt;&lt;a href="#"&gt;&lt;img id="cancle" src="/images/cancle.png"&gt;&lt;/a&gt;
   &lt;/form&gt;
  </code></pre>
  
  <p>result after typing something in the search box and pressing search :</p>
  
  <pre><code>win7-haystack
  win10-iceland
  win10-road
  </code></pre>