title: mysqli search like only works with 1 parameter
body: <p>I'm trying to do a mysqli search like query to search based on first and last name. When I type the first and last name into the search, I get no results. However, when I type just the first name or just the last name, I get results.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>&lt;?php
  if (isset($_POST['search'])) {
  $name = $_POST['search'];
  $sql = "SELECT * FROM users WHERE fname LIKE '%$name%' OR lname LIKE '%$name%'";
  $res = mysqli_query($conn, $sql);
  
  }
  while ($row = mysqli_fetch_assoc($res)) {
      $fname = $row['fname'];
      $lname = $row['lname'];
      $city = $row['city'];
      $state = $row['state'];
      $id = $row['id'];
      $url = '&lt;a href ="profile/?id='.$id.'"&gt;';
      if ($id !== ($_SESSION['id'])){
      $pic = "SELECT profilephotopatch FROM users WHERE id = '$id'";
      $res = mysqli_query($conn, $pic);
      $row = mysqli_fetch_assoc($res);
      $picloc = $row['profilephotopatch'];
      $displaypic = '&lt;div id="userphoto"&gt;&lt;img src="../'.$picloc. '"style="width: 100%;max-height: 100%"&gt;&lt;/div&gt;';
      $output = $displaypic. $url. '&lt;div id="name"&gt;'. $fname. ' '. $lname. ' '. $city. $state. '&lt;/a&gt;&lt;/div&gt;&lt;br&gt;';
   echo ($output);
  }
   }
   ?&gt;
  </code></pre>
  
  <p>Thanks in advance for the help!</p>